I'm trying to understand how recreating the node_modules directory for deployment works.
We're using npm ci instead of npm install to ensure a clean slate during deployment. However, when we run it without any flags, we get the following error:
Fix the upstream dependency conflict, or retry this command with --force, or --legacy-peer-deps to accept an incorrect (and potentially broken) dependency resolution.
The documentation for npm install for --force is as follows (there are no flags on npm ci's page):
The -f or --force argument will force npm to fetch remote resources even if a local copy exists on disk.
Meanwhile, the documentation for --legacy-peer-deps says:
--legacy-peer-deps: ignore all peerDependencies when installing, in the style of npm version 4 through version 6.
It seems that both flags will let npm ci generate the node_modules directory without any issues, but I am still unclear about the differences between the two.
From what I understand, --force sounds like it will be on a last-dependency-downloaded-wins basis and will overwrite any previously downloaded dependencies. Meanwhile, --legacy-peer-deps sounds like it will always skip peer dependencies (whatever those are) during installation even if there are no issues.
What are the differences between the two flags, and when should we use them?
In the new version of npm (v7), by default, npm install will fail when it encounters conflicting peerDependencies. It was not like that before.
Take a look here for more info about peer dependencies in npm v7.
The differences between the two are below -
--legacy-peer-deps: ignore all peerDependencies when installing, in the style of npm version 4 through version 6.
--strict-peer-deps: fail and abort the install process for any conflicting peerDependencies when encountered. By default, npm will only crash for peerDependencies conflicts caused by the direct dependencies of the root project.
--force: will force npm to fetch remote resources even if a local copy exists on disk.
In the article npm 7 is now generally available!,
You have the option to retry with --force to bypass the conflict or
--legacy-peer-deps command to ignore peer dependencies entirely
(this behavior is similar to versions 4-6).
I agree this sentence is not really clear, but "ignore peer dependencies entirely" does not sound good. Let's use a real example:
Here is a peer dependency error I met when I npm install:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: mobile#undefined
npm ERR! Found: react#17.0.1
npm ERR! node_modules/react
npm ERR! react#"17.0.1" from the root project
npm ERR! peer react#">=16.0.0" from #testing-library/react-native#7.2.0
npm ERR! node_modules/#testing-library/react-native
npm ERR! dev #testing-library/react-native#"7.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"16.13.1" from react-native#0.63.2
npm ERR! node_modules/react-native
npm ERR! react-native#"https://github.com/expo/react-native/archive/sdk-39.0.4.tar.gz" from the root project
npm ERR! peer react-native#">=0.59" from #testing-library/react-native#7.2.0
npm ERR! node_modules/#testing-library/react-native
npm ERR! dev #testing-library/react-native#"7.2.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/me/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/me/.npm/_logs/2021-03-13T00_10_33_813Z-debug.log
npm ERR! code 1
npm ERR! path /Users/me/my-app
npm ERR! command failed
npm ERR! command sh -c sh ./bin/setup.sh
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/me/.npm/_logs/2021-03-13T00_10_33_860Z-debug.log
Below is the package-lock.json difference between --legacy-peer-deps and --force.
If I run npm install --legacy-peer-deps, it adds this in my package-lock.json:
"node_modules/#unimodules/react-native-adapter": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/#unimodules/react-native-adapter/-/react-native-adapter-5.7.0.tgz",
"integrity": "sha512-L557/+sc8ZKJVgo1734HF1QNCxrt/fpqdmdNgySJT+kErux/AJNfPq3flsK0fyJduVmniTutYIMyW48cFoPKDA==",
"dependencies": {
"invariant": "^2.2.4",
"lodash": "^4.5.0"
},
"peerDependencies": {
"react-native": "*",
"react-native-web": "~0.13.7"
}
},
...
"#unimodules/react-native-adapter": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/#unimodules/react-native-adapter/-/react-native-adapter-5.7.0.tgz",
"integrity": "sha512-L557/+sc8ZKJVgo1734HF1QNCxrt/fpqdmdNgySJT+kErux/AJNfPq3flsK0fyJduVmniTutYIMyW48cFoPKDA==",
"requires": {
"invariant": "^2.2.4",
"lodash": "^4.5.0"
}
},
If I use npm install --force, instead, it adds
"node_modules/expo/node_modules/#unimodules/react-native-adapter": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/#unimodules/react-native-adapter/-/react-native-adapter-5.7.0.tgz",
"integrity": "sha512-L557/+sc8ZKJVgo1734HF1QNCxrt/fpqdmdNgySJT+kErux/AJNfPq3flsK0fyJduVmniTutYIMyW48cFoPKDA==",
"dependencies": {
"invariant": "^2.2.4",
"lodash": "^4.5.0"
},
"peerDependencies": {
"react-native": "*",
"react-native-web": "~0.13.7"
}
},
"node_modules/expo/node_modules/inline-style-prefixer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/inline-style-prefixer/-/inline-style-prefixer-5.1.2.tgz",
"integrity": "sha512-PYUF+94gDfhy+LsQxM0g3d6Hge4l1pAqOSOiZuHWzMvQEGsbRQ/ck2WioLqrY2ZkHyPgVUXxn+hrkF7D6QUGbA==",
"peer": true,
"dependencies": {
"css-in-js-utils": "^2.0.0"
}
},
"node_modules/expo/node_modules/react-native-web": {
"version": "0.13.18",
"resolved": "https://registry.npmjs.org/react-native-web/-/react-native-web-0.13.18.tgz",
"integrity": "sha512-WR/0ECAmwLQ2+2cL2Ur+0/swXFAtcSM0URoADJmG6D4MnY+wGc91JO8LoOTlgY0USBOY+qG/beRrjFa+RAuOiA==",
"peer": true,
"dependencies": {
"array-find-index": "^1.0.2",
"create-react-class": "^15.6.2",
"deep-assign": "^3.0.0",
"fbjs": "^1.0.0",
"hyphenate-style-name": "^1.0.3",
"inline-style-prefixer": "^5.1.0",
"normalize-css-color": "^1.0.2",
"prop-types": "^15.6.0",
"react-timer-mixin": "^0.13.4"
},
"peerDependencies": {
"react": ">=16.5.1",
"react-dom": ">=16.5.1"
}
},
...
"dependencies": {
"#unimodules/react-native-adapter": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/#unimodules/react-native-adapter/-/react-native-adapter-5.7.0.tgz",
"integrity": "sha512-L557/+sc8ZKJVgo1734HF1QNCxrt/fpqdmdNgySJT+kErux/AJNfPq3flsK0fyJduVmniTutYIMyW48cFoPKDA==",
"requires": {
"invariant": "^2.2.4",
"lodash": "^4.5.0"
}
},
"inline-style-prefixer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/inline-style-prefixer/-/inline-style-prefixer-5.1.2.tgz",
"integrity": "sha512-PYUF+94gDfhy+LsQxM0g3d6Hge4l1pAqOSOiZuHWzMvQEGsbRQ/ck2WioLqrY2ZkHyPgVUXxn+hrkF7D6QUGbA==",
"peer": true,
"requires": {
"css-in-js-utils": "^2.0.0"
}
},
"react-native-web": {
"version": "0.13.18",
"resolved": "https://registry.npmjs.org/react-native-web/-/react-native-web-0.13.18.tgz",
"integrity": "sha512-WR/0ECAmwLQ2+2cL2Ur+0/swXFAtcSM0URoADJmG6D4MnY+wGc91JO8LoOTlgY0USBOY+qG/beRrjFa+RAuOiA==",
"peer": true,
"requires": {
"array-find-index": "^1.0.2",
"create-react-class": "^15.6.2",
"deep-assign": "^3.0.0",
"fbjs": "^1.0.0",
"hyphenate-style-name": "^1.0.3",
"inline-style-prefixer": "^5.1.0",
"normalize-css-color": "^1.0.2",
"prop-types": "^15.6.0",
"react-timer-mixin": "^0.13.4"
}
}
}
},
As you see, npm install --force still pins many dependency versions which is stricter.
For those wondering which is safer, the answer is --force
--legacy-peer-deps ignores peer dependencies entirely, which can screw up your dependency resolution.
--force on the other hand simply sets a different peer dependency version for conflicting dependencies
Using force isn't always ideal though because each dependency version takes up extra space. Using force with many dependencies will increase your total space requirement a decent amount.
Related
Thanks for reading.
After testing some changes in my local dev environment and having no issues, I promoted the changes to my test environment hosted on AWS Amplify, and the build was failing with the following error:
2022-11-28T19:47:50.604Z [WARNING]: ERR! ERESOLVE could not resolve
npm ERR!
npm
2022-11-28T19:47:50.605Z [WARNING]: ERR! While resolving: styles#0.2.1
npm ERR! Found: assemble#0.24.3
npm ERR! node_modules/assemble
npm ERR!
2022-11-28T19:47:50.605Z [WARNING]: assemble#"^0.24.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer assemble#"~0.3.11" from styles#0.2.1
npm ERR! node_modules/styles
npm ERR! styles#"^0.2.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: assemble#0.3.83
npm ERR! node_modules/assemble
npm ERR! peer assemble#"~0.3.11" from styles#0.2.1
npm ERR! node_modules/styles
npm ERR! styles#"^0.2.1" from the root project
npm ERR!
npm ERR!
2022-11-28T19:47:50.605Z [WARNING]: Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /root/.npm/eresolve-report.txt for a full report.
Here are the two dependencies mentioned in the above error, in the package.json file:
"assemble": "^0.24.3",
"styles": "^0.2.1"
Here are the two dependencies mentioned above, in the package-lock file:
"node_modules/styles": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/styles/-/styles-0.2.1.tgz",
"integrity": "sha1-hJJ7pEf6pvJJ7NIK3wu4X606UUE=",
"dependencies": {
"less": "\~1.4.0"
},
"engines": {
"node": "\>= 0.8.0"
},
"peerDependencies": {
"assemble": "\~0.3.11",
"grunt": "\~0.4.0"
}
},
"node_modules/assemble": {
"version": "0.24.3",
"resolved": "https://registry.npmjs.org/assemble/-/assemble-0.24.3.tgz",
"integrity": "sha1-lSp3S3iAl6TW9Iw6QrpW9ouNZS8=",
"dependencies": {
"assemble-core": "^0.31.0",
"assemble-loader": "^1.0.5",
"base-argv": "^0.5.0",
"base-cli-process": "^0.1.19",
"base-config": "^0.5.2",
"base-questions": "^0.9.1",
"base-runtimes": "^0.2.0",
"cross-spawn": "^5.1.0",
"engine-handlebars": "^0.8.2",
"expand-front-matter": "^1.0.0",
"export-files": "^2.1.1",
"global-modules": "^0.2.3",
"is-valid-app": "^0.3.0",
"lazy-cache": "^2.0.2",
"log-utils": "^0.2.1",
"minimist": "^1.2.0",
"parser-front-matter": "^1.6.3",
"resolve-dir": "^1.0.0"
},
"bin": {
"assemble": "bin/cli.js"
},
"engines": {
"node": "\>=4.0"
}
},
I tried running the build with --force, and --legacy-peer-deps, but neither of the two dependencies mentioned above (assemble, and styles) are affected by either operation, and I still have the same issue.
I've tried installing the version of assemble to version 0.3.11 (as listed as the peerDependecy of styles), and again the build in my local environment works, but after promoting to my test environment on AWS Amplify, the build fails with the following errors:
2022-11-28T19:38:40.756Z [WARNING]: npm ERR!
2022-11-28T19:38:40.756Z [WARNING]: code EUSAGE
2022-11-28T19:38:40.760Z [WARNING]: npm
2022-11-28T19:38:40.760Z [WARNING]: ERR!
npm ERR! `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
npm ERR!
npm ERR! Missing: immutable#4.1.0 from lock file
npm ERR! Missing: seamless-immutable#7.1.4 from lock file
npm ERR! Missing: typescript#4.9.3 from lock file
I also uninstalled assemble and styles, but ran into the same error when trying to build the test environment.
Additionally, I went and looked at my commit history, and the package.json and package-lock.json files haven't been changed in months, and I've had many successful builds since they were last modified, which adds to my confusion of where this problem came from.
Further info:
Local Dev environment is using node v16.13.1 and npm v8.1.2, and Amplify build image (default image) just specifies in the build logs that its using Node version 16
Uninstalling both dependencies and then running npm update resolved my issues
I am trying to deploy my next.js project, but I keep getting the following error with everything I do:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: rcd_drone#0.1.0
npm ERR! Found: #sanity/client#3.4.1
npm ERR! node_modules/#sanity/client
npm ERR! #sanity/client#"^3.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer #sanity/client#"^2.11.0" from next-sanity-image#3.2.1
npm ERR! node_modules/next-sanity-image
npm ERR! next-sanity-image#"^3.2.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
I also have the following dependencies:
{
"name": "rcd_drone",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"#babel/core": "^7.17.9",
"#sanity/client": "^3.2.0",
"#sanity/image-url": "^1.0.1",
"#stripe/stripe-js": "^1.25.0",
"canvas-confetti": "^1.5.1",
"next": "^12.1.0",
"next-sanity-image": "^3.2.1",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-hot-toast": "^2.2.0",
"react-icons": "^4.3.1",
"frontmatter-markdown-loader": "^3.6.3",
"stripe": "^8.209.0"
},
"devDependencies": {
"#babel/preset-react": "^7.16.7",
"eslint": "8.13.0",
"eslint-config-next": "12.1.4"
}
}
Try doing the npm install --legacy-peer-deps within the Vercel project deploy page.
When deploying your project, go to the "build and output" settings, then in the npm command input write: npm install --legacy-peer-deps.
Select the override radio button, then try deploying.
Try deleting node_modules folder and package-lock.json file and run:
npm install --legacy-peer-deps
This is going to make fresh installation of the modules.
I am trying to clean out my react-native project's package to do a clean npm install on a MacOS based system (my windows system for Android development has no issues in cleaning up package versions).
I started seeing errors in the npm instals complaining version differences betwces are not compatible and list differences between versions of each package in "rook project" and node_modules/ directory.
I do the usual fix by removing package-lock.json, delete the node_modules directory and re-run npm install. from my project folder. It immediately made the same error complaints. The problem is this, there is no node_modules in my project folder as I deleted it. And it did not create a new node_modules directory.
Given this issue, how do I debug this and fix it? Questions I'd like to find out:
how do I tell npm to tell me what it thinks root project value is (full path)?
How to tell npm to tell me where the full path to the node_modules directory it seems to see?
Finally, how do I force npm to do the right thing and focus my my project's collaterals and not look outside the project folder as it appears to be doing?
Some of my thoughts. I don't understand why it is making a package cersion comparison between root project and node_modules?
Seems that nodde and npm are doing different things in MacOS environment than in my windows system environment -- I don't understand this.
Anyone here can help me understand what is going on and how to solve it?
The Error output here:
thomas#Presonus americanaradio % npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: AmericanaRadio#0.0.2
npm ERR! Found: react#16.14.0
npm ERR! node_modules/react
npm ERR! react#"^16.13.1" from the root project
npm ERR! peer react#"^16.8" from
#react-native-community/async-storage#1.12.1
npm ERR! node_modules/#react-native-community/async-storage
npm ERR! #react-native-community/async-storage#"^1.12.1" from the
root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"17.0.2" from react-native#0.66.4
npm ERR! node_modules/react-native
npm ERR! react-native#"^0.66.3" from the root project
npm ERR! peer react-native#">=0.59" from
#react-native-community/async-storage#1.12.1
npm ERR! node_modules/#react-native-community/async-storage
npm ERR! #react-native-community/async-storage#"^1.12.1" from the
root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency
resolution.
npm ERR!
npm ERR! See /Users/thomas/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/thomas/.npm/_logs/2021-12-10T15_47_02_669Z-debug.log
thomas#Presonus americanaradio %
The package.json content here:
{END)
"name": "AmericanaRadio",
"version": "0.0.2",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"#react-native-community/async-storage": "^1.12.1",
"#react-native-community/checkbox": "^0.5.2",
"#react-native-community/masked-view": "^0.1.10",
"#react-native-community/slider": "^3.0.3",
"node-fetch": "^2.6.1",
"react": "^16.13.1",
"react-native": "^0.66.3",
"react-native-background-timer": "^2.4.1",
"react-native-elements": "^3.4.2",
"react-native-gesture-handler": "^1.9.0",
"react-native-keyboard-aware-scroll-view": "^0.9.5",
"react-native-reanimated": "^2.2.4",
"react-native-safe-area-context": "^3.1.9",
"react-native-screens": "^2.15.2",
"react-native-simple-survey": "^3.1.2",
"react-native-swift": "^1.2.1",
"react-native-vector-icons": "^8.0.0",
"react-native-version-check": "^3.4.2",
"react-native-version-info": "^1.1.0",
"react-native-webview": "^11.3.1",
"react-navigation": "^4.4.3",
"react-navigation-drawer": "^2.6.0",
"react-navigation-stack": "^2.10.2",
"react-usestateref": "^1.0.8",
"socket.io-client": "^4.4.0"
},
"devDependencies": {
"#babel/core": "^7.12.10",
"#babel/runtime": "^7.12.5",
"#react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"eslint": "^7.18.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.64.0",
"react-test-renderer": "16.13.1"
},
"jest": {
"preset": "react-native"
}
}
~
(END)
As noted in my description, the node_modules directory was deleted and running npm install failed and did not create a nodes_modules directory. So the error messages are confusing as I have no packages in my project directory (americanaradio).
Thank you for taking a look at this and hopefully a solution can come out of ths.
First check what library is giving you an error and try to reinstall or update that version . Try deleting node modules also . Then do npm install.
I have installed the dependencies via npm below is the package.json
{
"name": "springbootreactjs2",
"version": "1.0.0",
"description": "Spring boot with reactjs",
"scripts": {
"watch": "webpack --watch -d"
},
"author": "",
"license": "ISC",
"dependencies": {
"axios": "^0.17.1",
"react": "16.0.0",
"react-dom": "^16.2.0",
"react-router-dom": "^4.2.2",
"rest": "^2.0.0",
"webpack": "^2.2.0"
},
"devDependencies": {
"babel-core": "^6.18.2",
"babel-loader": "7.1",
"babel-polyfill": "^6.16.0",
"babel-preset-es2015": "^6.18.0",
"babel-preset-react": "^6.16.0"
}
}
Whenever i want to install a dependency it keeps throwing the below error
npm WARN package.json springbootreactjs2#1.0.0 No repository field.
npm WARN package.json springbootreactjs2#1.0.0 No README data
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "install" "react#16.0.0" "--save"
npm ERR! node v4.2.2
npm ERR! npm v2.14.7
npm ERR! code EPEERINVALID
npm ERR! peerinvalid The package webpack#3.10.0 does not satisfy its siblings' p
eerDependencies requirements!
npm ERR! peerinvalid Peer babel-loader#6.4.1 wants webpack#1 || 2 || ^2.1.0-beta
|| ^2.2.0-rc
npm ERR! peerinvalid Peer webpack-dev-server#2.10.0 wants webpack#^2.2.0 || ^3.0
.0
npm ERR! Please include the following file with any support request:
Below is the install command i am running
npm install --save reactstrap#next react react-dom
Originally the webpack version was 3.10.0 i manually modified the webpack version to 2.2.0 but still for some reasons is still picking version 3.10.0.
Not sure what's wrong here
Remove any dependencies from your package.json file that you don't have installed locally and try again
Update your npm using npm install -g npm#latest.
Install the missing dependencies using npm install
<dependency_name> and run your command again.
If that doesn't work, read on:
I was facing the same issue. Although I was able to install webpack using npm, I couldn't install webpack-cli. So I:
1) Updated npm version to the latest.
Installed yarn (using yum
or apt-get, etc.).
Installed all the dependencies(including
webpack-cli) using yarn
This solved my problem.
My issue appears after (or even during) the creation of the angular project with the command:
yo angular
during the process of installing all the devDependencies from the package.json ("npm install" which yo angular runs) I notice that some modules are missing in the node_modules folder.
So, I downloaded after that again with the "npm install name_of_the_module --save-dev" (so they will download and be included in the package.json in the devDependencies option).
But for example If I remove the node_modules folder and I execute the command npm install it will start the installation but will miss some modules, and sometimes the missing modules are different from the last run of npm install.
I don't know how to face this because I need to set up the project for the team and the first thing they will have to do is executing npm install & bower install (this last one works fine).
The content of package.json is:
{
"name": "angular_test",
"version": "0.0.0",
"dependencies": {},
"devDependencies": {
"grunt": "^0.4.5",
"grunt-autoprefixer": "^0.7.6",
"grunt-concurrent": "^0.5.0",
"grunt-contrib-clean": "^0.5.0",
"grunt-contrib-concat": "^0.4.0",
"grunt-contrib-connect": "^0.7.1",
"grunt-contrib-copy": "^0.5.0",
"grunt-contrib-cssmin": "^0.9.0",
"grunt-contrib-htmlmin": "^0.3.0",
"grunt-contrib-imagemin": "^0.8.1",
"grunt-contrib-jshint": "^0.10.0",
"grunt-contrib-uglify": "^0.4.1",
"grunt-contrib-watch": "^0.6.1",
"grunt-filerev": "^0.2.1",
"grunt-google-cdn": "^0.4.0",
"grunt-karma": "^0.9.0",
"grunt-newer": "^0.7.0",
"grunt-ng-annotate": "^0.3.2",
"grunt-svgmin": "^0.4.0",
"grunt-usemin": "^2.4.0",
"grunt-wiredep": "^1.7.0",
"imagemin-jpegtran": "^2.0.0",
"imagemin-pngquant": "^2.0.0",
"jshint-stylish": "^0.2.0",
"karma": "^0.12.24",
"karma-jasmine": "^0.1.5",
"karma-phantomjs-launcher": "^0.1.4",
"load-grunt-tasks": "^0.6.0",
"time-grunt": "^0.3.2"
},
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"test": "grunt test"
}
}
and the errors or log I get after executing npm install is:
npm WARN optional dep failed, continuing imagemin-optipng#1.0.0
npm WARN optional dep failed, continuing http-signature#0.10.0
npm WARN optional dep failed, continuing imagemin-jpegtran#1.0.0
npm WARN optional dep failed, continuing imagemin-pngquant#1.0.2
npm WARN optional dep failed, continuing imagemin-gifsicle#1.0.0
npm ERR! EEXIST, open 'C:\Users\myself\AppData\Roaming\npm-cache\78af9c6a-m-cache-lodash-2-4-1-package-tgz.lock'
File exists: C:\Users\myself\AppData\Roaming\npm-cache\78af9c6a-m-cache-lodash-2-4-1-package-tgz.lock
Move it away, and try again.
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd C:\Users\myself\Documents\PHPStorm_Workspace\angular_test
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! path C:\Users\myself\AppData\Roaming\npm-cache\78af9c6a-m-cache-lodash-2-4-1-package-tgz.lock
npm ERR! code EEXIST
npm ERR! errno 47
npm ERR! not ok code 0
UPDATE
All these issues appear because of "npm" so after researching a little bit, the creator of npm suggested to download the last version, which is only available either...
npm install -g npm#next
or
npm install -g npm#2.1.2 (in this case is only for the current release 2.1.2, which is the latest release)
or
Downloading the source and copying its content where npm is installed (inside the node_modules folder where you installed node.js):
https://www.versioneye.com/nodejs/npm/2.1.2
When I find the github discussion I will update the post with it.
This is bug and can be fixed by update your npm version (https://github.com/npm/npm/issues/6318).
Try: npm -g install npm#next
File exists:
C:\Users\myself\AppData\Roaming\npm-cache\78af9c6a-m-cache-lodash-2-4-1-package-tgz.lock
Move it away, and try again.
It seems like npm is resolvng from your cache, try # npm cache clear (for more info) to make sure a package isn’t loading anything from npm’s cache.
Most likely due to this bug in npm.