Previously my company had been using node-sass v3.13.1 which is out of date and will return a 404 now. I updated it a while back to load v4.9.4. It was a pain and it kept wanting to reload 3.13.1 but eventually it worked, I forget how. Anyways, now I am on a new computer and reinstalling the npm packages using npm install and it is AGAIN searching for this v3.13.1. This stupid thing just doesn't die. Of course it fails with a 404.
Things I've done:
I confirmed that the only node-sass reference in package.json is 4.9.4.
I confirmed that the only node-sass reference in package-lock.json is 4.9.4
I ran npm cache clean --force
I double checked that my git bash is set to the correct directory when running npm install
I double checked that the correct package.json and package-lock.json are in that same directory
I ran npm install node-sass#4.9.4 and it responded saying it was loading a cached binary found at .... then it started loading node-sass#3.13.1
I'm at a loss. How do I kill this thing once and for all to never ever allow npm to try to load this stupid outdated package?
I ended up finding a solution. The problem was that I had another package gulp-sass that was out of date. I updated it to 3.0.0 in the package.json and it worked. The solution I found was here:
https://github.com/codecombat/codecombat/issues/4430
Related
My Expo project is pretty much 9999999% errors thus far, and it finally reached its climax when it decided to throw an error I've never heard of at me:
module not found: can't resolve '../utilities/platform'
I've never seen this, and I was explicitly working in an isolated styling file when it occurred. I deleted the file and the error persisted. Seeing that it was in node_modules, I figured that deleting node_modules would be helpful. It wasn't. I deleted the node_modules and tried to run npm i --save afterwards but it kept erroring out. I restarted my computer, deleted the new node_modules, and tried to run npm i --save yet again. This time I was greeted with this:
read-shrinkwrap This version of npm is compatible with lockfileVersion#1, but package-lock.json
was generated for lockfileVersion#2. I'll try to do my best with it!
npm ERR! Maximum call stack size exceeded
Now, I have a half(ish) completed node_modules, and whenever I try to run expo start, which I have about 700000000 times before this, it tells me this...
Unable to find expo in this project - have you run yarn / npm install yet?
Which, yes stupid I have my expo set up, and yes AGAIN, I just ran npm install about twenty-two times. So I have absolutely no idea what happened, why it happened, or how to fix whatever happened. If you can help me I will award you my first born but fair warning that might take another 20 years
Try to remove all react-native data folders from "%appdata%\Temp" and execute following commands:
cd android (if any)
gradlew clean
cd.. and remove the node_modules folder
npm cache clean --force
npm install
npm start -- --reset-cache
This is to get some clarification on the behaviour of npm with regards to package.json and package-lock.json.
The scenario is this, my package.json has an dependency like this:
"xxx-package" : "^7.34.0"
When I ran 'npm install' on a fresh machine (with no node_modules folder and no package-lock.json), the installer found a newer version of the package "7.36.0" and installed that instead. This is correct since we have the caret(^) sign in the dependency list.
But here is the confusing part: npm then created a package-lock.json with the new updated version but never changed the package.json listing. So now the package-lock.json shows "7.36.0" but package.json is still showing the lower version.
Also, 'npm outdated' and 'npm update' will not do anything since the version in package-lock matches the latest.
My app ran fine on "7.34.0" but a fresh install breaks it, and I spent a lot of time trying to fix a possible bug in my app. Only when I checked the package-lock did I realize that this was due to a newer version and not my code.
Is there a way to make sure package.json is updated whenever a new version gets installed using 'npm install'?
Or are we doing something wrong ?
npm version is 7.9.0
node version is 15.3.0
Every single package I install using npm i is extraneous and is not added to package.json. With npm i --save, it will get added but I wonder why this is. I've tested in different directories to make sure the problem is not the parent folder having a node_modules folder.
I'm using node 8.10.0 and npm 3.5.2
So I updated npm using npm, I deleted the local repo and cloned it again, I created test node projects in different directories but the problem persisted.
I'm not sure what stopped it because it resolved on its own after a while, but before that, I was running npm i with --save.
I have an Electron app that I'm trying to install node modules for. When I run npm install, it creates the node_modules folder but all the modules go into a subfolder called .staging. Each module also has -xxxxx appended to it, where the x's are some random alphanumerics.
Other Electron apps I've created have never done this. All the node modules sit in the root of node_modules and don't have -xxxxx appended.
Any idea why this is happening?
I was also facing the same issue, I tried the steps below:
Delete package-lock.json
Delete Node Modules folder
Try installing it using below command (should be in open network)
npm install
Note: - ".staging" means, those dependencies are getting downloaded so for the temporary basis it keeps all those dependencies under ".staging" folder. Once all gets downloaded properly then it will showcase them under node_modules only.
I hope this will work.
This only happens temporarily until the modules are downloaded and installed. Node seems to do this so it can place together common submodules from all the modules you are installing so it can better structure the node modules folder(mainly for windows users).
If this is happening after an npm install finishes it is likely that there is something wrong with your node installation or something in the install failed.
If you're automatically installing node_modules using CI/CD you should check out npm ci. Also check out this Stackoverflow question.
npm ci
The documentation points out the differences between npm install and npm ci.
The project must have an existing package-lock.json or npm-shrinkwrap.json
If dependencies in the package lock do not match those in package.json, npm ci will exit with an error, instead of updating the package lock.
npm ci can only install entire projects at a time: individual dependencies cannot be added with this command.
If a node_modules is already present, it will be automatically removed before npm ci begins its install. This is nice, because it prevents having to do something like rm -rf node_modules.
It will never write to package.json or any of the package-locks: installs are essentially frozen.
.staging is a temporary npm folder, where the modules are temporarily saved while they are being downloaded, if the package.json downloads are still not completed, the created folder remains, until the installation is complete.
The problem may be lack of space on your hard drive.
I was having 2 versions of node installed on my system.
nodejs v4.2 and node v8.6
I thought this could be conflicting, so I deleted nodejs v4.2 with following commands.
sudo apt-get remove nodejs
and linked the path with
sudo ln -s /usr/bin/node /usr/bin/nodejs
Again I ran npm install and it got fixed
Delete package.lock.json
Delete node_modules
run npm update
This worked for me
I moved the project from C drive to other drive and ran the following commands
take a backup of older node modules if you are running this and existing project
npm cache clean --force
npm update
I faced similar issue and tried the above answers but it did'nt worked for me;
I followed below steps to resolve this issue-
1.npm audit
By running npm audit I got list of pending packages to install-
2.npm i packagename
After installing one or two package one by one from list, I used
3.npm install
At this time the installation went smooth without any lag or hangup. Hope this help who is facing similar issue :).
Sometimes the cache is corrupt and also unremovable.
This fixed the issue I was experiencing.
If you are using nvm
Get the current node version node --version
nvm uninstall (that version)
nvm install (that version)
nvm use
npm install
If you have a windows machine where you do not posses Admin rights to it.
Try deleting node_modules and install using 'npm install' from command line as
'ADMINISTRATOR'
It works!
Anyways, it comes down to an open network thing ;)
I'm trying to use a gulp project on my Linux machine. The readme for the project tells me to first run sudo npm install -g gulp bower, then in the project directory run sudo npm install and then bower install. Everything up to this point works just fine for me. However, after that I try to run gulp dist and get this error:
Error: `libsass` bindings not found in /[PROJECT DIRECTORY]/trunk/node_modules/gulp-sass/node_modules/node-sass/vendor/linux-x64-14/binding.node. Try reinstalling `node-sass`?
Googling that error produced this: libsass bindings not found when using node-sass in nodejs, which I tried, but that didn't fix anything. When I looked through that directory that gulp said it couldn't find the difference was the linux-x64-14, mine said linux-x64-11, so I'm assuming I have the wrong version? Just for fun I decided to try changing the name of that folder to what it wanted, and I got a different error:
Error: Module did not self-register.
The really strange thing about all this is that when I tried getting this project working on my Windows machine I didn't have any of these issues, it just worked. I have no idea what I'm doing wrong, any ideas?
I've solved this by updating GCC from 4.4.x to 4.7.x.
Because GCC 4.4.x cannot compile node-sass of current version.
It worked for me using below commands. Try it
npm rebuild node-sass
rm -rf node_modules
npm i
This error usually shows up for us when we update our node or io.js version.
I would recommend deleting your node_modules folder and running npm install again.
If that doesn't work it is probably worth deleting your npm cache. There are a number of ways to do it including just a simple npm cache clean
I would also recommend deleting your ~/.npm folder as well just to be sure.
If this doesn't work let me know and we can start debugging your actual Node version and your package.json