I’m having this issue with npm where I cannot install the packages in my package.json on my home network. I tried countless “fixes” (including modifying the registry to http instead of https, modifying the proxy and https-proxy, using unsafe-perm, installing the packages individually, etc.) but none of them seem to work. I decided to try installing them while connected to my phone’s LTE hotspot and miraculously it worked normally. Now my next issue is, what could be causing this?
When I install on my network, it starts to slow down and then completely stops and hangs (on a random package). After a few tries, I was able to install yarn, and could install my dependencies with it.
Extra info:
I tried this on multiple node/npm versions but still hangs
Verbose install on npm doesn’t give much information, but usually hangs here [.....] \ extract:rxjs: sill extract rxjs#6.3.3 extracted to /home/abbas/git/abbas-yadollahi/node_modules/.staging/rxjs-36adb757 160099ms
My network is fine as far as I know (50/10 up/down and I’m on LAN)
Related
I'm new to js and trying to setup a simple project with express and nodemon via npm.
However, installing these packages does give me multiple errors (see below).
I am on Win 10, using the PowerShell & Atom IDE. Project is saved on Google Drive.
"Calc.js" is simply the name of my project.
I have node & npm installed and restarted pc multiple times before.
Then I set up the npm init
I begin to install the first package and get this error:
I try to install express, but get the same result, adding -g also does not make a difference. Now I install "ci", which works for some reason.
Now I have the node modules folder in my project, try to install express again, and it seems to kinda work (got the files in the node_modules folder).
However when I try to run the calc.js via "node calc.js" it
does not work.
Already tried out many things and even accidentally made it work, then tried to reproduce it and failed. Would be super happy for some help.
For some context, I am a web developer by day, but in the evenings, I work on a personal project using React Native, and I'm still fairly new to it. The app was working totally fine up until a couple of days ago, and I'm not entirely what caused it. Even if I revert back in GitHub, things still do not work.
Things that I think have caused it are:
Running 'npm audit fix --force'
Or updating node, npm, or expo-cli
What I've tried so far:
I've gone back to a previous commit where the app was definitely working, tried to start the app ('expo start'), but to no avail
I've made sure the package.json, package-lock.json, and yarn.lock were all reverted, and then ran 'npm install', and the yarn equivalent (I'm aware you shouldn't mix package managers but this has been like it even when the app was working, so fairly sure this isn't the issue)
Un-ignored node_modules/ in .gitignore, then deleted them from the project, and ran 'npm install', and yarn equivalent
Tried clearing all caches (npm, metro etc.)
'expo doctor --fix dependencies'
Tried reverting expo-cli to a previous version, same with npm and node
Debugged the app with remote debugger in Chrome which I'll explain below...
Symptoms of the issue:
It seems to be at build time (I think?) because the app never makes it to any kind of components or screens:Error in iOS simulator when I try to serve my app using 'expo start' and 'i'
r/reactnative - how can I fix my app after 'npm audit fix --force'
Error in iOS simulator when I try to serve my app using 'expo start' and 'i'
The message I'm getting is 'no stack', because of a "}" symbol (pics will be included), and when I trace this down to its root using the remote debugging in chrome, the caught exception that it paused on was something like 'can't use import statement outside of a module', and the line seems to be referring to Babel module:Using Expo remote debugger in Chrome
r/reactnative - how can I fix my app after 'npm audit fix --force'
Using Expo remote debugger in Chrome
When I try to serve the app on web, I get a different Webpack related error (please see screenshots)
I won't put my package.json etc. here because it'll be a wall of text, but here's my repo if anyone would like to see the dev dependencies etc.: https://github.com/braingame-com/bg1
This has caused me so much frustration that I considered just rebuilding the app from scratch because it's not very far along anyway, but I'm really wanting to get my debugging skills up and learn what I had done wrong, rather than taking the easy way out.
What can I try next?
bit of a bizarre one, Gulp doesn't seem to work as expected. It loads tasks for one of my modules, however it doesn't seem to load for my other module. I have tried your standard npm audit then npm audit fix --force however this doesn't resolve it. Process 1:
Task 2:
When attempting to do Ctrl+Alt+O the only help I seem to get is the npm audit
Anyone got any ideas? This is not due to an issue with the file. This works for many others which use the software, and I can access the file fine. I did originally have issues with IIS certificates, however I generated my own IIS one.
I have been using Browsershot to retrieve some images from my website without any issues for months, but recently (past 1-2 weeks), the request has been timing out. Looking further into it, I've found that it has been consuming a large amount of cpu power while trying to execute the command.
As far as I can tell, this constant CPU drain will continue until I restart the server. I also only requested for one image to be made in this example, yet there are three processes of chrome. I'm not sure if that's irregular.
In order to make sure that it wasn't something on my website or possibly a setting causing this, I used a simple function call.
Browsershot::url("https://example.com")
->setScreenshotType('png')
->save(Storage::path("overview_images/test.png"));
Unfortunately the problem still occurs.
I am using a Laravel provisioned Forge server, so I used the installation recommended by the Github page. Like I said, it had been working fine up until a couple of weeks ago. No changes were made to Browsershot around that time that would cause something like this. I have tried following the steps to install again, but it still happens.
Any help is greatly appreciated!
Edit 1:
After looking into it further, I've figured out that the problem lies within Puppeteer, not Browsershot. I tried implementing the example.js provided by Google, and I ran into the exact same problem.
Edit 2:
Somehow I was able to get it fixed. I can't tell exactly what did it, but I may be able to offer some help to anyone else who may find this question.
Running ndb example.js, I got the message
Downloading Chromium r624492...
ERROR: Failed to download Chromium r624492!
Error: EACCES: permission denied
Even though I had installed puppeteer (multiple times), I guess it was continuously trying and failing to download Chromium. I assume this is why the CPU usage was so high and never stopped until the server was restarted.
With that said, I didn't change anything specifically that made it suddenly start working. If it helps at all, this was a series of commands that I used when it suddenly started to work.
> node example.js // Didn't Work. Would be in continuous command with high CPU usage until cancelled
> sudo npm install -g ndb
> ndb example.js // This is when I received the message about downloading Chomium
> node example.js // It worked ?
Still don't know the exact reason for why this is happening, so I'll leave this as an open question if anybody can figure that out.
Edit 3:
It broke again.
I think I've finally figured it out.
From Browsershot's Github page, it recommends executing these commands to install puppeteer.
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget libgbm-dev libxshmfence-dev
sudo npm install --global --unsafe-perm puppeteer
sudo chmod -R o+rx /usr/lib/node_modules/puppeteer/.local-chromium
The npm install fails installing the chromium part of puppeteer despite the --unsafe-perm.
Changing --unsafe-perm to --unsafe-perm=true seems to have fixed it.
So changing the command to the following should fix the install and actually download Chromium.
sudo npm install -g puppeteer --unsafe-perm=true
I am currently trying to download node.js. I have downloaded everything and am now at the part where I enter the console commands.
What I am entering:
cd node
./configure
make
after entering ./configure, i get this error
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer director /Library/Developer/CommandLineTools' is a command line tools instance`
I'm not sure what this means. After entering make, i then get this repeated in a infinite loop in the console
http://pastebin.com/YrDs2Afw
in general it's a good rule of thumb to provide a bit information about what you already tried and on what system you are - especially when you are having issues with installing something.
I'll just assume, that you're working on a Mac.
I would recommend to download and install XCode as Quentin already recommended.
You can find it in the AppStore.
Once that done, make sure to install the "Command Line Tools" within XCode.
Now you have several options:
- Install Homebrew and install NodeJS from there (google Homebrew if you don't know what it is)
- Download and execute the Node v0.10.26.pkg (current version as of writing this), which will take care of the installation for you.
Hope this helps