Reputation: 53
Having an issue with npm install on my project. Used to be ok just few days ago.
Solutions like
npm cache clean —force
deleted node-modules
package-lock.json
npm install
Those steps havent helps.
I have created gist so you could see the error and maybe understand more then i do.
Many thanks in advance.
https://gist.github.com/ladygo93/c2c5c87759bc33210866418e457165d3
FIXED
So had an upgrade to node.js
16+, forced node-sass
to v6.0.1
while upgrading react-scripts
manually to v4.0.3 from v4.0.0 that way issue is gone for now.
Upvotes: 2
Views: 100
Reputation: 47662
Older version of node-sass don't work with new versions of Node.js. You can find the exact version requirements here. Similarly, newer versions on npm use newer version of Node.js (see here). And in fact, npm is bundled in the Node.js installer.
If node-sass is a dependency defined in your package.json, updating to a newer version should fix the error. If node-sass is a transitive dependency or if you cannot update it because of compatibility issues, you'll have to stick to the old versions of Node.js and npm.
Upvotes: 2
Reputation: 27
You have to use the older version of npm used in the production. You can do it two ways:
1: Install the older version of npm using npm -g install npm@6
2: Use npx
to install a different version of npm while keeping the current version of npm in your system. Use command npx -p npm@6
Upvotes: 0