Unable to resolve dependency tree Reactjs - javascript

I am trying to install react-tinder-card in my current project.So i am tring to install the react-tinder-card but after i use the command
npm install --save react-tinder-card
All i can see in my console is:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: tinder-clone#0.1.0
npm ERR! Found: react#17.0.1
npm ERR! node_modules/react
npm ERR! react#"^17.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.8.0" from react-tinder-card#1.3.1
npm ERR! node_modules/react-tinder-card
npm ERR! react-tinder-card#"*" 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 /home/nero/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/nero/.npm/_logs/2020-11-06T16_36_39_957Z-debug.log
When i opened the debug.log file, i found this:
0 verbose cli [
0 verbose cli '/usr/bin/node',
0 verbose cli '/usr/bin/npm',
0 verbose cli 'install',
0 verbose cli '--save',
0 verbose cli 'react-tinder-card'
0 verbose cli ]
1 info using npm#7.0.3
2 info using node#v15.0.1
3 timing config:load:defaults Completed in 3ms
4 timing config:load:file:/usr/lib/node_modules/npm/npmrc Completed in 0ms
5 timing config:load:builtin Completed in 1ms
6 timing config:load:cli Completed in 3ms
7 timing config:load:env Completed in 1ms
8 timing config:load:file:/home/nero/Documents/MERN/tinder-clone/.npmrc Completed in 1ms
9 timing config:load:project Completed in 2ms
10 timing config:load:file:/home/nero/.npmrc Completed in 0ms
11 timing config:load:user Completed in 0ms
12 timing config:load:file:/usr/etc/npmrc Completed in 0ms
13 timing config:load:global Completed in 0ms
14 timing config:load:cafile Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:setUserAgent Completed in 0ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 12ms
19 verbose npm-session b46c4469ef66a9f2
20 timing npm:load Completed in 19ms
21 timing arborist:ctor Completed in 0ms
22 timing idealTree:init Completed in 1413ms
23 timing idealTree:userRequests Completed in 3ms
24 silly idealTree buildDeps
25 silly fetch manifest react-tinder-card#*
26 http fetch GET 200 https://registry.npmjs.org/react-tinder-card 188ms (from cache)
27 silly fetch manifest react#^17.0.1
28 timing arborist:ctor Completed in 0ms
29 http fetch GET 304 https://registry.npmjs.org/react 1196ms (from cache)
30 timing idealTree Completed in 2812ms
31 timing command:install Completed in 2815ms
32 verbose stack Error: unable to resolve dependency tree
32 verbose stack at Arborist.[failPeerConflict] (/usr/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/arborist/build-ideal-tree.js:1011:25)
32 verbose stack at Arborist.[loadPeerSet] (/usr/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/arborist/build-ideal-tree.js:991:36)
32 verbose stack at async Arborist.[buildDepStep] (/usr/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/arborist/build-ideal-tree.js:760:11)
32 verbose stack at async Arborist.buildIdealTree (/usr/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/arborist/build-ideal-tree.js:202:7)
32 verbose stack at async Promise.all (index 1)
32 verbose stack at async Arborist.reify (/usr/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/arborist/reify.js:121:5)
32 verbose stack at async install (/usr/lib/node_modules/npm/lib/install.js:40:5)
33 verbose cwd /home/nero/Documents/MERN/tinder-clone
34 verbose Linux 5.4.0-52-generic
35 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "--save" "react-tinder-card"
36 verbose node v15.0.1
37 verbose npm v7.0.3
38 error code ERESOLVE
39 error ERESOLVE unable to resolve dependency tree
40 error
41 error While resolving: [1mtinder-clone[22m#[1m0.1.0[22m
41 error Found: [1mreact[22m#[1m17.0.1[22m[2m[22m
41 error [2mnode_modules/react[22m
41 error [1mreact[22m#"[1m^17.0.1[22m" from the root project
41 error
41 error Could not resolve dependency:
41 error [35mpeer[39m [1mreact[22m#"[1m^16.8.0[22m" from [1mreact-tinder-card[22m#[1m1.3.1[22m[2m[22m
41 error [2mnode_modules/react-tinder-card[22m
41 error [1mreact-tinder-card[22m#"[1m*[22m" from the root project
41 error
41 error Fix the upstream dependency conflict, or retry
41 error this command with --force, or --legacy-peer-deps
41 error to accept an incorrect (and potentially broken) dependency resolution.
41 error
41 error See /home/nero/.npm/eresolve-report.txt for a full report.
42 verbose exit 1
I don't understand what that means. Please help me find the solution.Any sort of help would be appreciated.
Thank you in advance.

$ npm install --save react-tinder-card --legacy-peer-deps

This error comes from version 7.x of npm.
Please try again with the --legacy-peer-deps option.

What this error basically says is that react-tinder-card#1.3.1 in it's peer dependencies has react#"^16.8.0". So it needs that version of react to function properly. On your tinder-clone#0.1.0 application you currently have react#17.0.1.
This problem can be solved manually by just installing version of react that react-tinder-card#1.3.1 needs which is react#"^16.8.0", so you need to downgrade your version to run the package.
The --legacy-peer-deps flag was introduced with v7 of npm as a way to bypass peerDependency auto-installation; it tells NPM to ignore peer deps and proceed with the installation anyway. This can cause some unwanted behavior and I would not suggest it.

Downgrade to npm v6. It should fix the issue.
npm install -g npm#6

This happens when you are trying to clone a project which is built a long time ago, and project dependencies have moved on to newer versions.
Just run below code. Works fine for me every time. You should also see this solution with the error.
npm install --legacy-peer-deps

https://www.apollographql.com/docs/react/migrating/apollo-client-3-migration/
The react-apollo package has been deprecated, and the functionality offered by each of the above packages can now be accessed from #apollo/client directly:
#apollo/react-hooks -> now available directly from #apollo/client
#apollo/react-components -> now available from #apollo/client/react/components
#apollo/react-hoc -> now available from #apollo/client/react/hoc
#apollo/react-ssr -> now available from #apollo/client/react/ssr
#apollo/react-testing -> now available from #apollo/client/testing

I had the same error above. I installed npm v6.7. I reinstalled Netlify CMS and Gatsby:
npm install netlify-cms-app#2.9 gatsby-plugin-netlify-cms#^4.0.0
I don't have anything under the static folder except a favicon.ico file. No admin folder and no .yml file.

Downgrading the npm version to version 6 helped me resolve the issue.

Upgrade to npm v8. It should fix the issue.
npm install -g npm#8

since using --legacy-peer-deps flag wont install the dev-dependencies your react version, use --force instead.

Related

npm dependencies error while updating or installing npm on old project

There is this very old project i am trying to run, whenever i try to npm install or start the project it gives of various dependencies error especially errors of outdated npm version, i have the latest version of node(16.x) while this project has an outdated(14.x) version of node. npm update does not work either, any suggestions how can i run this project?
here's the log file for 'npm install'
0 verbose cli C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js
1 info using npm#8.15.0
2 info using node#v16.17.1
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 2ms
5 timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 3ms
6 timing config:load:builtin Completed in 3ms
7 timing config:load:cli Completed in 2ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:D:\FYP\Project Frontend\fyp\.npmrc Completed in 0ms
10 timing config:load:project Completed in 2ms
11 timing config:load:file:C:\Users\Administrator\.npmrc Completed in 0ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:C:\Users\Administrator\AppData\Roaming\npm\etc\npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:credentials Completed in 2ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 14ms
19 timing npm:load:configload Completed in 14ms
20 timing npm:load:mkdirpcache Completed in 1ms
21 timing npm:load:mkdirplogs Completed in 1ms
22 verbose title npm install
23 verbose argv "install"
24 timing npm:load:setTitle Completed in 2ms
25 timing config:load:flatten Completed in 4ms
26 timing npm:load:display Completed in 6ms
27 verbose logfile logs-max:10 dir:C:\Users\Administrator\AppData\Local\npm-cache\_logs
28 verbose logfile C:\Users\Administrator\AppData\Local\npm-cache\_logs\2022-10-12T16_19_59_564Z-debug-0.log
29 timing npm:load:logFile Completed in 11ms
30 timing npm:load:timers Completed in 0ms
31 timing npm:load:configScope Completed in 0ms
32 timing npm:load Completed in 36ms
33 timing arborist:ctor Completed in 1ms
34 silly logfile start cleaning logs, removing 2 files
35 silly logfile done cleaning log files
36 timing idealTree:init Completed in 1762ms
37 warn old lockfile
37 warn old lockfile The package-lock.json file was created with an old version of npm,
37 warn old lockfile so supplemental metadata must be fetched from the registry.
37 warn old lockfile
37 warn old lockfile This is a one-time fix-up, please be patient...
37 warn old lockfile
And here's the error
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: undefined,
npm WARN EBADENGINE required: { node: '14.x' },
npm WARN EBADENGINE current: { node: 'v16.17.1', npm: '8.15.0' }
npm WARN EBADENGINE }
npm WARN deprecated #types/classnames#2.3.1: This is a stub types definition. classnames provides its own type definitions, so you do not need this installed.
npm WARN deprecated source-map-url#0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated stable#0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN deprecated flatten#1.0.3: flatten is deprecated in favor of utility frameworks such as lodash.
npm WARN deprecated request-promise-native#1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated #hapi/bourne#1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated #hapi/topo#3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
npm WARN deprecated hoek#4.2.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated source-map-resolve#0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated chokidar#2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated chokidar#2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated mini-create-react-context#0.4.1: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated left-pad#1.3.0: use String.prototype.padStart()
npm WARN deprecated redux-devtools-extension#2.13.9: Package moved to #redux-devtools/extension.
npm WARN deprecated sane#4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm WARN deprecated eslint-loader#3.0.3: This loader has been deprecated. Please use eslint-webpack-plugin
npm WARN deprecated #hapi/address#2.1.4: Moved to 'npm install #sideway/address'
npm WARN deprecated html-webpack-plugin#4.0.0-beta.11: please switch to a stable version
npm WARN deprecated querystring#0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated babel-eslint#10.1.0: babel-eslint is now #babel/eslint-parser. This package will no longer receive updates.
Solution 1 (Recommended)
I suggest that to use a tool for switching versions of node and npm called nvm. By the way, you don't have to upgrade/downgrade whole project dependencies. It is a minimal solution and it will work on further projects.
To install nvm check the table of contents section in here.
After installation of nvm:
Step 1
Installing desired node version
nvm install v14.18.0
Also you can check supported versions by this command
nvm ls-remote
Step2
Switching version
nvm use v14.18.0
Step 3
npm install
Solution 2
It is more painful because you must repeat each project's steps.
Downgrade your node version to "14.x.x"
Delete the package-lock.json (because you installed it for the new version of the node)
And install dependencies.
And repeat these steps for different versioned projects.

Tailwind - Autoprefixer already exists

when installing tailwind I get the following error:
admin#admin-VirtualBox:~/Desktop/Code/react_app/client$ npm install -D tailwindcss postcss autoprefixer
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: react-app#1.0
npm ERR! Found: autoprefixer#9.7.1
npm ERR! node_modules/autoprefixer
npm ERR! autoprefixer#"^9.6.1" from postcss-preset-env#6.7.0
npm ERR! node_modules/postcss-preset-env
npm ERR! postcss-preset-env#"6.7.0" from react-scripts#3.2.0
npm ERR! node_modules/react-scripts
npm ERR! react-scripts#"3.2.0" from the root project
npm ERR! dev autoprefixer#"*" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev autoprefixer#"*" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: postcss#8.4.13
npm ERR! node_modules/postcss
npm ERR! peer postcss#"^8.1.0" from autoprefixer#10.4.7
npm ERR! node_modules/autoprefixer
npm ERR! dev autoprefixer#"*" 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 /home/admin/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/admin/.npm/_logs/2022-05-17T19_33_57_115Z-debug-0.log
I am using the following package.json file:
{
"name": "react-app",
"version": "1.0",
"private": true,
"dependencies": {
"babel-eslint": "10.0.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-router": "^6.3.0",
"react-scripts": "3.2.0",
"web3": "^1.6.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
This is the fill log:
0 verbose cli [
0 verbose cli '/usr/local/bin/node',
0 verbose cli '/usr/local/bin/npm',
0 verbose cli 'install',
0 verbose cli '-D',
0 verbose cli 'tailwindcss',
0 verbose cli 'postcss',
0 verbose cli 'autoprefixer'
0 verbose cli ]
1 info using npm#8.5.5
2 info using node#v16.15.0
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 8ms
6 timing config:load:builtin Completed in 8ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:/home/admin/Desktop/Code/react_app/client/.npmrc Completed in 0ms
10 timing config:load:project Completed in 2ms
11 timing config:load:file:/home/admin/.npmrc Completed in 1ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:/usr/local/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:credentials Completed in 0ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 14ms
19 timing npm:load:configload Completed in 14ms
20 timing npm:load:setTitle Completed in 0ms
21 timing config:load:flatten Completed in 2ms
22 timing npm:load:display Completed in 3ms
23 verbose logfile /home/admin/.npm/_logs/2022-05-17T19_33_57_115Z-debug-0.log
24 timing npm:load:logFile Completed in 2ms
25 timing npm:load:timers Completed in 0ms
26 timing npm:load:configScope Completed in 0ms
27 timing npm:load Completed in 19ms
28 timing arborist:ctor Completed in 1ms
29 silly logfile start cleaning logs, removing 1 files
30 timing idealTree:init Completed in 769ms
31 timing idealTree:userRequests Completed in 1ms
32 silly idealTree buildDeps
33 silly fetch manifest tailwindcss#*
34 timing arborist:ctor Completed in 0ms
35 http fetch GET 200 https://registry.npmjs.org/tailwindcss 796ms (cache hit)
36 silly fetch manifest postcss#*
37 http fetch GET 200 https://registry.npmjs.org/postcss 8ms (cache hit)
38 silly fetch manifest autoprefixer#*
39 http fetch GET 200 https://registry.npmjs.org/autoprefixer 5ms (cache hit)
40 timing idealTree Completed in 1610ms
41 timing command:install Completed in 1615ms
42 verbose stack Error: could not resolve
42 verbose stack at PlaceDep.failPeerConflict (/usr/local/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/place-dep.js:546:25)
42 verbose stack at PlaceDep.place (/usr/local/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/place-dep.js:197:21)
42 verbose stack at new PlaceDep (/usr/local/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/place-dep.js:71:10)
42 verbose stack at /usr/local/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/arborist/build-ideal-tree.js:964:31
42 verbose stack at Array.map (<anonymous>)
42 verbose stack at Arborist.[buildDepStep] (/usr/local/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/arborist/build-ideal-tree.js:964:8)
42 verbose stack at async Arborist.buildIdealTree (/usr/local/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/arborist/build-ideal-tree.js:216:7)
42 verbose stack at async Promise.all (index 1)
42 verbose stack at async Arborist.reify (/usr/local/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/arborist/reify.js:153:5)
42 verbose stack at async Install.exec (/usr/local/lib/node_modules/npm/lib/commands/install.js:159:5)
43 verbose cwd /home/admin/Desktop/Code/react_app/client
44 verbose Linux 5.13.0-40-generic
45 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-D" "tailwindcss" "postcss" "autoprefixer"
46 verbose node v16.15.0
47 verbose npm v8.5.5
48 error code ERESOLVE
49 error ERESOLVE could not resolve
50 error
51 error While resolving: [1mreact-app[22m#[1m1.0[22m
51 error Found: [1mautoprefixer[22m#[1m9.7.1[22m[2m[22m
51 error [2mnode_modules/autoprefixer[22m
51 error [1mautoprefixer[22m#"[1m^9.6.1[22m" from [1mpostcss-preset-env[22m#[1m6.7.0[22m[2m[22m
51 error [2mnode_modules/postcss-preset-env[22m
51 error [1mpostcss-preset-env[22m#"[1m6.7.0[22m" from [1mreact-scripts[22m#[1m3.2.0[22m[2m[22m
51 error [2mnode_modules/react-scripts[22m
51 error [1mreact-scripts[22m#"[1m3.2.0[22m" from the root project
51 error [33mdev[39m [1mautoprefixer[22m#"[1m*[22m" from the root project
51 error
51 error Could not resolve dependency:
51 error [33mdev[39m [1mautoprefixer[22m#"[1m*[22m" from the root project
51 error
51 error Conflicting peer dependency: [1mpostcss[22m#[1m8.4.13[22m[2m[22m
51 error [2mnode_modules/postcss[22m
51 error [35mpeer[39m [1mpostcss[22m#"[1m^8.1.0[22m" from [1mautoprefixer[22m#[1m10.4.7[22m[2m[22m
51 error [2mnode_modules/autoprefixer[22m
51 error [33mdev[39m [1mautoprefixer[22m#"[1m*[22m" from the root project
51 error
51 error Fix the upstream dependency conflict, or retry
51 error this command with --force, or --legacy-peer-deps
51 error to accept an incorrect (and potentially broken) dependency resolution.
51 error
51 error See /home/admin/.npm/eresolve-report.txt for a full report.
52 verbose exit 1
53 timing npm Completed in 1755ms
54 verbose unfinished npm timer reify 1652816037244
55 verbose unfinished npm timer reify:loadTrees 1652816037246
56 verbose unfinished npm timer idealTree:buildDeps 1652816038016
57 verbose unfinished npm timer idealTree:#root 1652816038016
58 verbose code 1
59 error A complete log of this run can be found in:
59 error /home/admin/.npm/_logs/2022-05-17T19_33_57_115Z-debug-0.log
Any suggestions what I am doing wrong?
I appreciate your replies!
Your problem lies in using multiple conflicting versions of autoprefixer. Those come from different packages, for instance react-scripts. I noticed that, while your react is pretty up-to-date, your react-scripts are two major versions behind (3.2.0 vs. 5.0.1). This means there have been two times breaking changes in between, which could easily explain the conflict. If you aren't sure what that means, head over to Semver for an explanation.
I can't possibly tell if this is going to resolve the problem, but I would make a quick copy of the project, remove all dependencies from package.json and run npm i babel-eslint react react-dom react-router react-scripts web3. There are more sophisticated ways to do this, but this would quickly tell you, if updating all packages fixes the problem.

'node' is not recognized as an internal or external command, operable program or batch file

I'm running "npm install node-sass" from git-bash-cli in Windows 10 and getting a "'node' is not recognized as an internal or external command,
operable program or batch file." error.
I have been using this setup for years and the issues started when I upgraded node to 10.16.0
To prevent unnecessary replies:
All the questions I have seen simply say to add the path variable.
I have added Node to the PATH variable and tried a number of different ways of writing it. I ended up reinstalling Node.js and that does it automatically, so I just left it as that.
node runs from the command line, just not from scripts, like scripts in the package.json file.
I have tried reinstalling node 8.11.3, which is the version I was using before the problems started, but I get the same error. I am back to v 10.16.0 again.
Error code is as follows:
> node-sass#4.12.0 install C:\projects\true\true\website\truevue\node_modules\node-sass
> node scripts/install.js
'node' is not recognized as an internal or external command,
operable program or batch file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.0.7 (node_modules\#nuxt\builder\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.0.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.7 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass#4.12.0 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#4.12.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Peter\AppData\Roaming\npm-cache\_logs\2019-07-24T23_41_06_896Z-debug.log
Here's the log when I run npm run dev on a Vue project I'm working on
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\Peter\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'dev' ]
2 info using npm#6.10.2-next.1
3 info using node#v10.16.0
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle thisistrue.co#1.0.0~predev: thisistrue.co#1.0.0
6 info lifecycle thisistrue.co#1.0.0~dev: thisistrue.co#1.0.0
7 verbose lifecycle thisistrue.co#1.0.0~dev: unsafe-perm in lifecycle true
8 verbose lifecycle thisistrue.co#1.0.0~dev: PATH: C:\Users\Peter\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\projects\true\true\website\truevue\node_modules\.bin
9 verbose lifecycle thisistrue.co#1.0.0~dev: CWD: C:\projects\true\true\website\truevue
10 silly lifecycle thisistrue.co#1.0.0~dev: Args: [ '/d /s /c',
10 silly lifecycle 'cross-env NODE_ENV=development nodemon server/index.js --watch server' ]
11 silly lifecycle thisistrue.co#1.0.0~dev: Returned: code: 1 signal: null
12 info lifecycle thisistrue.co#1.0.0~dev: Failed to exec dev script
13 verbose stack Error: thisistrue.co#1.0.0 dev: `cross-env NODE_ENV=development nodemon server/index.js --watch server`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Users\Peter\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:317:16)
13 verbose stack at EventEmitter.emit (events.js:198:13)
13 verbose stack at ChildProcess.<anonymous> (C:\Users\Peter\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:198:13)
13 verbose stack at maybeClose (internal/child_process.js:982:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid thisistrue.co#1.0.0
15 verbose cwd C:\projects\true\true\website\truevue
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Peter\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev"
18 verbose node v10.16.0
19 verbose npm v6.10.2-next.1
20 error code ELIFECYCLE
21 error errno 1
22 error thisistrue.co#1.0.0 dev: `cross-env NODE_ENV=development nodemon server/index.js --watch server`
22 error Exit status 1
23 error Failed at the thisistrue.co#1.0.0 dev script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Finally found an answer to this.
All I ended up doing was running npm update -g and it fixed the issue
Thanks all who helped, hope this can help someone else
I think you must add the path of node.js to the system variable
First: open Control Panel -> System and Security -> System -> Advanced System Settings -> Environment Variables
Second: in "User variables" or "System variables" find variable PATH and add node.js folder path as value.it is C:\Program Files\nodejs;If it doesn't exists, create it.
Third: Restart your computer.

npm won't install forked git repo

trying to install a forked version of ng2-smart-table for my app but npm is not doing it.
I've used
npm install git+http://github.com/myusername/ng2-smart-table.git
npm install git://github.com/myusername/ng2-smart-table.git
npm install github.com/myusername/ng2-smart-table
and many other variations. I get the following error.
npm ERR! addLocal Could not install /tmp/npm-24904-e690204a/git-cache-97763c70/bb5d603024d75ce8a664d949a646ca7c7c29b0a0
npm ERR! Linux 3.10.0-693.5.2.el7.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "git://github.com/myusername/ng2-smart-table.git"
npm ERR! node v6.11.1
npm ERR! npm v3.10.10
npm ERR! No version provided in package.json
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /home/myname/my-app/npm-debug.log
[root#stackc-pre-staging my-app]# vim /home/myname/my-app/npm-debug.log
[root#stackc-pre-staging my-app]# npm install git+http://github.com/myusername/ng2-smart-table.git
npm ERR! addLocal Could not install /tmp/npm-25075-02c22b92/git-cache-ba6c0ee9/bb5d603024d75ce8a664d949a646ca7c7c29b0a0
npm ERR! Linux 3.10.0-693.5.2.el7.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "git+http://github.com/myusername/ng2-smart-table.git"
npm ERR! node v6.11.1
npm ERR! npm v3.10.10
npm ERR! No version provided in package.json
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /home/myname/my-app/npm-debug.log
Contents of /home/myname/my-app/npm-debug.log:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node',
1 verbose cli '/usr/bin/npm',
1 verbose cli 'install',
1 verbose cli 'git+http://github.com/myusername/ng2-smart-table.git' ]
2 info using npm#3.10.10
3 info using node#v6.11.1
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData git+http://github.com/myusername/ng2-smart-table.git
8 silly fetchOtherPackageData git+http://github.com/myusername/ng2-smart-table.git
9 silly cache add args [ 'git+http://github.com/myusername/ng2-smart-table.git', null ]
10 verbose cache add spec git+http://github.com/myusername/ng2-smart-table.git
11 silly cache add parsed spec Result {
11 silly cache add raw: 'git+http://github.com/myusername/ng2-smart-table.git',
11 silly cache add scope: null,
11 silly cache add escapedName: null,
11 silly cache add name: null,
11 silly cache add rawSpec: 'git+http://github.com/myusername/ng2-smart-table.git',
11 silly cache add spec: 'http://github.com/myusername/ng2-smart-table.git',
11 silly cache add type: 'git' }
12 verbose addRemoteGit caching git+http://github.com/myusername/ng2-smart-table.git
13 silly tryClone cloning git+http://github.com/myusername/ng2-smart-table.git via git+http://github.com/myusername/ng2-smart-table.git
14 verbose tryClone git-http-github-com-myusername-ng2-smart-table-git-6513bc33 not in flight; caching
15 verbose correctMkdir /root/.npm/_git-remotes correctMkdir not in flight; initializing
16 info git [ 'clone',
16 info git '--template=/root/.npm/_git-remotes/_templates',
16 info git '--mirror',
16 info git 'http://github.com/myusername/ng2-smart-table.git',
16 info git '/root/.npm/_git-remotes/git-http-github-com-myusername-ng2-smart-table-git-6513bc33' ]
17 verbose mirrorRemote git+http://github.com/myusername/ng2-smart-table.git git clone http://github.com/myusername/ng2-smart-table.git Cloning into bare repository '/root/.npm/_git-remotes/git-http-github-com-myusername-ng2-smart-table-git-6513bc33'...
18 verbose correctMkdir /root/.npm/_git-remotes correctMkdir not in flight; initializing
19 verbose setPermissions git+http://github.com/myusername/ng2-smart-table.git set permissions on /root/.npm/_git-remotes/git-http-github-com-myusername-ng2-smart-table-git-6513bc33
20 verbose resolveHead git+http://github.com/myusername/ng2-smart-table.git original treeish: master
21 info git [ 'rev-list', '-n1', 'master' ]
22 silly resolveHead git+http://github.com/myusername/ng2-smart-table.git resolved treeish: bb5d603024d75ce8a664d949a646ca7c7c29b0a0
23 verbose resolveHead git+http://github.com/myusername/ng2-smart-table.git resolved Git URL: git+ssh://git#github.com/myusername/ng2-smart-table.git#bb5d603024d75ce8a664d949a646ca7c7c29b0a0
24 silly resolveHead Git working directory: /tmp/npm-25075-02c22b92/git-cache-ba6c0ee9/bb5d603024d75ce8a664d949a646ca7c7c29b0a0
25 info git [ 'clone',
25 info git '/root/.npm/_git-remotes/git-http-github-com-myusername-ng2-smart-table-git-6513bc33',
25 info git '/tmp/npm-25075-02c22b92/git-cache-ba6c0ee9/bb5d603024d75ce8a664d949a646ca7c7c29b0a0' ]
26 verbose cloneResolved git+http://github.com/myusername/ng2-smart-table.git clone Cloning into '/tmp/npm-25075-02c22b92/git-cache-ba6c0ee9/bb5d603024d75ce8a664d949a646ca7c7c29b0a0'...
26 verbose cloneResolved done.
27 info git [ 'checkout', 'bb5d603024d75ce8a664d949a646ca7c7c29b0a0' ]
28 verbose checkoutTreeish git+http://github.com/myusername/ng2-smart-table.git checkout Note: checking out 'bb5d603024d75ce8a664d949a646ca7c7c29b0a0'.
28 verbose checkoutTreeish
28 verbose checkoutTreeish You are in 'detached HEAD' state. You can look around, make experimental
28 verbose checkoutTreeish changes and commit them, and you can discard any commits you make in this
28 verbose checkoutTreeish state without impacting any branches by performing another checkout.
28 verbose checkoutTreeish
28 verbose checkoutTreeish If you want to create a new branch to retain commits you create, you may
28 verbose checkoutTreeish do so (now or later) by using -b with the checkout command again. Example:
28 verbose checkoutTreeish
28 verbose checkoutTreeish git checkout -b new_branch_name
28 verbose checkoutTreeish
28 verbose checkoutTreeish HEAD is now at bb5d603... Added a show/hide variable to column settings so that you can toggle visibility of columns
29 info git [ 'submodule', '-q', 'update', '--init', '--recursive' ]
30 verbose updateSubmodules git+http://github.com/myusername/ng2-smart-table.git submodule update
31 error addLocal Could not install /tmp/npm-25075-02c22b92/git-cache-ba6c0ee9/bb5d603024d75ce8a664d949a646ca7c7c29b0a0
32 silly fetchPackageMetaData Error: No version provided in package.json
32 silly fetchPackageMetaData at /usr/lib/node_modules/npm/lib/cache/add-local.js:73:17
32 silly fetchPackageMetaData at /usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:356:5
32 silly fetchPackageMetaData at checkBinReferences_ (/usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:320:45)
32 silly fetchPackageMetaData at final (/usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:354:3)
32 silly fetchPackageMetaData at then (/usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:124:5)
32 silly fetchPackageMetaData at /usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:243:12
32 silly fetchPackageMetaData at /usr/lib/node_modules/npm/node_modules.bundled/graceful-fs/graceful-fs.js:78:16
32 silly fetchPackageMetaData at tryToString (fs.js:456:3)
32 silly fetchPackageMetaData at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:443:12)
32 silly fetchPackageMetaData error for git+http://github.com/myusername/ng2-smart-table.git Error: No version provided in package.json
32 silly fetchPackageMetaData at /usr/lib/node_modules/npm/lib/cache/add-local.js:73:17
32 silly fetchPackageMetaData at /usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:356:5
32 silly fetchPackageMetaData at checkBinReferences_ (/usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:320:45)
32 silly fetchPackageMetaData at final (/usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:354:3)
32 silly fetchPackageMetaData at then (/usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:124:5)
32 silly fetchPackageMetaData at /usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:243:12
32 silly fetchPackageMetaData at /usr/lib/node_modules/npm/node_modules.bundled/graceful-fs/graceful-fs.js:78:16
32 silly fetchPackageMetaData at tryToString (fs.js:456:3)
32 silly fetchPackageMetaData at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:443:12)
33 silly rollbackFailedOptional Starting
34 silly rollbackFailedOptional Finishing
35 silly runTopLevelLifecycles Finishing
36 silly install printInstalled
37 verbose stack Error: No version provided in package.json
37 verbose stack at /usr/lib/node_modules/npm/lib/cache/add-local.js:73:17
37 verbose stack at /usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:356:5
37 verbose stack at checkBinReferences_ (/usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:320:45)
37 verbose stack at final (/usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:354:3)
37 verbose stack at then (/usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:124:5)
37 verbose stack at /usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:243:12
37 verbose stack at /usr/lib/node_modules/npm/node_modules.bundled/graceful-fs/graceful-fs.js:78:16
37 verbose stack at tryToString (fs.js:456:3)
37 verbose stack at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:443:12)
38 verbose cwd /home/myname/my-app
39 error Linux 3.10.0-693.5.2.el7.x86_64
40 error argv "/usr/bin/node" "/usr/bin/npm" "install" "git+http://github.com/myusername/ng2-smart-table.git"
41 error node v6.11.1
42 error npm v3.10.10
43 error No version provided in package.json
44 error If you need help, you may report this error at:
44 error <https://github.com/npm/npm/issues>
45 verbose exit [ 1, true ]
Is this a permissions issue? Or is there something wrong with the way npm is set up? Any help would be appreciated.
Try recreating package.json for that repo with npm init . command and go through all the steps.
Remember having correct repository link in the repository section.
I had the same problem but above helped.
Problem 1: The repo on your post does not exist.
You might've used the wrong repo url.
Use the correct repo url: https://github.com/akveo/ng2-smart-table
Problem 2: The repo does not have a version specified in the package.json
Just fork it and add a version in the package.json file.
Or, use the npm version,
npm install --save ng2-smart-table

npm install -g . doesn't copy, fails

The npm developer docs say to make sure your package installs globally before publishing by running npm install -g .. I'm trying to build an ES6 CLI package that can be installed and run globally, but after running Babel to transpile it (with the es2015 plugin), the global install on my machine fails.
I've created a simple demo ES6 project that reproduces the error. Cloning and running npm install -g . throws the error in the README:
$ npm install -g .
> es6-test#0.0.1 prepublish /Users/me/dev/es6-test
> npm run build
> es6-test#0.0.1 build /Users/me/dev/es6-test
> babel --out-dir es5/ src/
src/bin/app.js -> es5/bin/app.js
src/core/location.js -> es5/core/location.js
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/Cellar/node/5.4.0/bin/node" "/usr/local/bin/npm" "install" "-g" "."
npm ERR! node v5.4.0
npm ERR! npm v3.3.12
npm ERR! path /usr/local/lib/node_modules/es6-test/es5/bin/app
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/local/lib/node_modules/es6-test/es5/bin/app'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /Users/me/dev/es6-test/npm-debug.log
Am I doing something wrong? I've tried a few different commands, with both Babel and NPM, but ultimately nothing seems to get copied into /usr/local/lib/node_modules.
$ node -v
v5.4.0
$ npm -v
3.3.12
EDIT: The error appears to be the same with the latest node and v0.10.24, with and without sudo. The logfile says:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/5.4.0/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'i',
1 verbose cli '-g',
1 verbose cli '.gs' ]
2 info using npm#3.3.12
3 info using node#v5.4.0
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData .gs
8 silly fetchOtherPackageData .gs
9 silly cache add args [ '.gs', null ]
10 verbose cache add spec .gs
11 silly cache add parsed spec Result {
11 silly cache add raw: '.gs',
11 silly cache add scope: null,
11 silly cache add name: null,
11 silly cache add rawSpec: '.gs',
11 silly cache add spec: '/Users/me/dev/es6-test/.gs',
11 silly cache add type: 'local' }
12 error addLocal Could not install /Users/me/dev/es6-test/.gs
13 silly fetchPackageMetaData Error: ENOENT: no such file or directory, open '/Users/me/dev/es6-test/.gs'
13 silly fetchPackageMetaData at Error (native)
13 silly fetchPackageMetaData error for .gs { [Error: ENOENT: no such file or directory, open '/Users/me/dev/es6-test/.gs']
13 silly fetchPackageMetaData errno: -2,
13 silly fetchPackageMetaData code: 'ENOENT',
13 silly fetchPackageMetaData syscall: 'open',
13 silly fetchPackageMetaData path: '/Users/me/dev/es6-test/.gs' }
14 silly rollbackFailedOptional Starting
15 silly rollbackFailedOptional Finishing
16 silly runTopLevelLifecycles Starting
17 silly runTopLevelLifecycles Finishing
18 silly install printInstalled
19 verbose stack Error: ENOENT: no such file or directory, open '/Users/me/dev/es6-test/.gs'
19 verbose stack at Error (native)
20 verbose cwd /Users/me/dev/es6-test
21 error Darwin 14.5.0
22 error argv "/usr/local/Cellar/node/5.4.0/bin/node" "/usr/local/bin/npm" "i" "-g" ".gs"
23 error node v5.4.0
24 error npm v3.3.12
25 error path /Users/me/dev/es6-test/.gs
26 error code ENOENT
27 error errno -2
28 error syscall open
29 error enoent ENOENT: no such file or directory, open '/Users/me/dev/es6-test/.gs'
29 error enoent This is most likely not a problem with npm itself
29 error enoent and is related to npm not being able to find a file.
30 verbose exit [ -2, true ]
The "bin" property of the package.json points to an app.js file in es5/bin but there is no app.js file. You'll need to point it to the csp.js file:
package.json
"bin": {
"csp": "es5/bin/csp.js"
},

Categories