Npm install fails due to invalid version - npm

So as part of some work I'm doing, I am trying to get the packages we use in our application up to the latest versions as when running npm audit there were a significant amount of vulnerabilities.
One of the the things it comes up saying to install mocha#9.2.2
I have been trying to do this but I get an error saying:
npm ERR! Invalid version: ^6.0.1
I have no idea what this is referring to as in the package.json there are no packages that have this version and when I look at the debug log I just get:
207 verbose stack TypeError: Invalid Version: ^6.0.1
207 verbose stack at new SemVer (C:\Program Files\nodejs\node_modules\npm\node_modules\semver\classes\semver.js:38:13)
207 verbose stack at compare (C:\Program Files\nodejs\node_modules\npm\node_modules\semver\functions\compare.js:3:32)
207 verbose stack at Object.gte (C:\Program Files\nodejs\node_modules\npm\node_modules\semver\functions\gte.js:2:30)
207 verbose stack at CanPlaceDep.checkCanPlaceCurrent (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\arborist\lib\can-place-dep.js:173:51)
207 verbose stack at CanPlaceDep.checkCanPlace (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\arborist\lib\can-place-dep.js:157:27)
207 verbose stack at new CanPlaceDep (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\arborist\lib\can-place-dep.js:114:26)
207 verbose stack at PlaceDep.place (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\arborist\lib\place-dep.js:121:19)
207 verbose stack at new PlaceDep (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\arborist\lib\place-dep.js:71:10)
207 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\arborist\lib\arborist\build-ideal-tree.js:949:31
207 verbose stack at Array.map (<anonymous>)
208 verbose cwd C:\tfs\Agility\Branches\AgilityMakeover\Client\Web\AgilityItemViewer
209 verbose Windows_NT 10.0.19044
210 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "mocha#9.2.2"
211 verbose node v16.14.0
212 verbose npm v8.3.1
213 error Invalid Version: ^6.0.1
214 verbose exit 1
So I have no idea what this could be referring to, as far as I can tell there is no package reference. I have tried just removing the package-lock.json file and the deleting the node_modules folder and running npm install again but I keep getting this error. But I have no clue on how to progress, any advice would be appreciated

What eventually seemed to solve the problem for me was going through the list of packages shown i.e semver, can-place-dep etc and updating them all manually by doing: npm update semver and so on. I then deleted my package-lock.json and node_modules folder again and did npm install. After this I stopped getting the invalid version error. Hopefully this can help someone else if they end up having the same issue I had

Try this
Delete npm_modules folder
Delete the package.json.lock file
run npm cache clean --force
And try npm install

Related

How do I fix this issue in react native project - "npm ERR! Invalid tag name ">=^16.8.1"" this issue?

I am getting this error when install the node modules(npm install). Why this issue happening in react native project? Is this related to node version ?
Error :
npm ERR! code EINVALIDTAGNAME npm ERR! Invalid tag name ">=^16.8.1":
Tags may not have any characters that encodeURIComponent encodes. npm
ERR! A complete log of this run can be found in:
/Users/abcdef/.npm/_logs/2021-08-02T05_31_11_609Z-debug.log
Error Log (debug.log)
109 verbose stack Error: Invalid tag name ">=^16.8.1": Tags may not have any characters that encodeURIComponent encodes.
109 verbose stack at invalidTagName (/usr/local/lib/node_modules/npm/node_modules/npm-package-arg/npa.js:89:15)
109 verbose stack at fromRegistry (/usr/local/lib/node_modules/npm/node_modules/npm-package-arg/npa.js:343:13)
109 verbose stack at Function.resolve (/usr/local/lib/node_modules/npm/node_modules/npm-package-arg/npa.js:80:12)
109 verbose stack at Arborist.[nodeFromEdge] (/usr/local/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/arborist/build-ideal-tree.js:949:37)
109 verbose stack at async Arborist.[loadPeerSet] (/usr/local/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/arborist/build-ideal-tree.js:1170:23)
109 verbose stack at async Arborist.[buildDepStep] (/usr/local/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/arborist/build-ideal-tree.js:886:11)
109 verbose stack at async Arborist.buildIdealTree (/usr/local/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/arborist/build-ideal-tree.js:218:7)
109 verbose stack at async Promise.all (index 1)
109 verbose stack at async Arborist.reify (/usr/local/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/arborist/reify.js:134:5)
109 verbose stack at async Install.install (/usr/local/lib/node_modules/npm/lib/install.js:150:5)
110 verbose cwd /Users/abcde/Project/XXX/Workspace/xyz-app
111 verbose Darwin 19.6.0
112 verbose argv "/usr/local/Cellar/node/16.4.2/bin/node" "/usr/local/bin/npm" "i"
113 verbose node v16.4.2
114 verbose npm v7.20.2
115 error code EINVALIDTAGNAME
116 error Invalid tag name ">=^16.8.1": Tags may not have any characters that encodeURIComponent encodes.
117 verbose exit 1
I got the solution for this issue. We can fix this issue in two ways,
Downgrade the npm version(In my case, I have downgraded it to 6.14.14 after that it's working fine.)
npm install -g npm#6.14.14
In the terminal, navigate to your project root directory and run this
npm install --legacy-peer-deps

Skip a package when running `npm -g outdated`

I have a package that I manually updated in order to have multiple versions of the same tool running (as explained here).
Now, when I execute npm -g outdated, I am getting the following output:
$ npm -g outdate
npm notice
npm notice New minor version of npm available! 7.18.1 -> 7.20.1
npm notice Changelog: https://github.com/npm/cli/releases/tag/v7.20.1
npm notice Run npm install -g npm#7.20.1 to update!
npm notice
npm ERR! code ENOVERSIONS
npm ERR! No versions available for ask-cli-1
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/b/.npm/_logs/2021-07-24T13_02_50_529Z-debug.log
Here are the contents of the log, edited for brevity:
0 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', '-g', 'update' ]
1 info using npm#7.18.1
2 info using node#v16.4.1
...
9 timing config:load:file:/usr/local/lib/node_modules/ask-cli-1/.npmrc Completed in 0ms
...
33 silly fetch manifest ask-cli-1#*
34 http fetch GET 200 https://registry.npmjs.org/ask-cli-1 38ms (cache hit)
...
40 silly placeDep ROOT ask-cli-1# OK for: want: *
...
316 timing idealTree:node_modules/ask-cli-1 Completed in 0ms
...
1338 verbose stack ask-cli-1: No versions available for ask-cli-1
1338 verbose stack at pickManifest (/usr/local/lib/node_modules/npm/node_modules/npm-pick-manifest/index.js:140:25)
1338 verbose stack at module.exports (/usr/local/lib/node_modules/npm/node_modules/npm-pick-manifest/index.js:187:16)
1338 verbose stack at /usr/local/lib/node_modules/npm/node_modules/pacote/lib/registry.js:118:26
1338 verbose stack at async Arborist.[nodeFromEdge] (/usr/local/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/arborist/build-ideal-tree.js:936:19)
1338 verbose stack at async Arborist.[buildDepStep] (/usr/local/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/arborist/build-ideal-tree.js:882:11)
1338 verbose stack at async Arborist.buildIdealTree (/usr/local/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/arborist/build-ideal-tree.js:218:7)
1338 verbose stack at async Arborist.reify (/usr/local/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/arborist/reify.js:134:5)
1338 verbose stack at async Update.update (/usr/local/lib/node_modules/npm/lib/update.js:72:5)
1339 verbose cwd /usr/local/lib/node_modules/ask-cli-1
1340 verbose Darwin 20.5.0
1341 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "-g" "update"
1342 verbose node v16.4.1
1343 verbose npm v7.18.1
1344 error code ENOVERSIONS
1345 error No versions available for ask-cli-1
1346 verbose exit 1
Is there a way to avoid npm looking for a version of ask-cli-1?
You can't exclude a package with npm outdated.
But I recomemnd this package: check-outdated
In your case npm i -g check-outdated
Then:
check-outdated --ignore-packages ask-cli-1 --columns name,type,current,latest,changes

NPM outdated throws npm ERR! Not implemented yet

Since I updated to npm 6.9.0 (node 8.12.0) I'm getting this error when running npm outdated:
$ npm outdated
npm ERR! Not implemented yet
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/jgallaso/.npm/_logs/2019-04-10T11_13_48_791Z-debug.log
The logs shows this error:
173 verbose stack Error: Not implemented yet
173 verbose stack at Object.packument (/Users/jgallaso/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/pacote/lib/fetchers/remote.js:12:22)
173 verbose stack at Object.Fetcher#packument [as packument] (/Users/jgallaso/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/genfun/lib/genfun.js:15:38)
173 verbose stack at packument (/Users/jgallaso/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/pacote/lib/fetch.js:17:18)
173 verbose stack at pinflight (/Users/jgallaso/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/pacote/packument.js:23:12)
173 verbose stack at /Users/jgallaso/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/promise-inflight/inflight.js:29:24
173 verbose stack at Promise._execute (/Users/jgallaso/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/bluebird/js/release/debuggability.js:313:9)
173 verbose stack at Promise._resolveFromExecutor (/Users/jgallaso/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:483:18)
173 verbose stack at new Promise (/Users/jgallaso/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:79:10)
173 verbose stack at _inflight (/Users/jgallaso/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/promise-inflight/inflight.js:28:25)
173 verbose stack at /Users/jgallaso/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/promise-inflight/inflight.js:22:14
173 verbose stack at tryCatcher (/Users/jgallaso/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
173 verbose stack at Promise._settlePromiseFromHandler (/Users/jgallaso/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
173 verbose stack at Promise._settlePromise (/Users/jgallaso/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
173 verbose stack at Promise._settlePromiseCtx (/Users/jgallaso/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:606:10)
173 verbose stack at _drainQueueStep (/Users/jgallaso/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:142:12)
173 verbose stack at _drainQueue (/Users/jgallaso/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:131:9)
When I run npm outdated on a specific package, for instance eslint I get the proper output:
$ npm outdated eslint
Package Current Wanted Latest Location
eslint 5.15.1 5.16.0 5.16.0
What's happening here? Is it due to some buggy package or a bug NPM itself?
As a temporal solution you can install the latest npm:
npm i npm -g
npm i then npm update worked for me.

npm install using node-gyp works from CLI, fails from TeamCity

I'm stuck with an unreliable build in TeamCity.
When executing an npm install for my project that indirectly uses node-gyp to compile a solution, crucially it only fails with when executed from the TeamCity agent.
[EDIT AFTER ANSWER] The context of execution is from Build Step that executes a custom build.ps1 which automates the build process - covering c#, npm projects, executes unit tests etc. This is to say it isn't a bunch of discrete steps in TeamCity but a single PowerShell command that can execute from any environment.
If I execute from the command line on the same server, same user that the TeamCity Agent runs under, it works fine.
These are the errors from the build agent...
MSBuild: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe
Executing Build
configuration: debug
Restoring npm for src\my-corp-app
> scrypt#6.0.3 preinstall D:\IR\my-corp-app\TcBuild\src\my-corp-app\node_modules\scrypt
> node node-scrypt-preinstall.js
> keccak#1.4.0 install D:\IR\my-corp-app\TcBuild\src\my-corp-app\node_modules\keccak
> npm run rebuild || echo "Keccak bindings compilation fail. Pure JS implementation will be used."
> keccak#1.4.0 rebuild D:\IR\my-corp-app\TcBuild\src\my-corp-app\node_modules\keccak
> node-gyp rebuild
D:\IR\my-corp-app\TcBuild\src\my-corp-app\node_modules\keccak>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
D:\IR\my-corp-app\TcBuild\src\my-corp-app\node_modules\keccak\build\keccak.vcxproj(21,3): error MSB4019: The imported project "D:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
gyp ERR! build error
gyp ERR! stack Error: `msbuild` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\IR\my-corp-app\TcBuild\src\my-corp-app\node_modules\keccak
gyp ERR! node -v v8.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! keccak#1.4.0 rebuild: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the keccak#1.4.0 rebuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\teamcity_user\AppData\Roaming\npm-cache\_logs\2019-02-13T11_38_48_872Z-debug.log
"Keccak bindings compilation fail. Pure JS implementation will be used."
The work around is to execute the command line, it succeeds, then execute in TeamCity again and the recent artifacts from the command line execution make it skip this node-gyp process and the build succeeds. This workaround is getting tiresome.
I've unsucessfully followed the various googled suggestions for fixing "C:\Microsoft.Cpp.Default.props" was not found errors:
npm install --global --production windows-build-tools
Set / Clear VCTargetsPath
Have also compared the environment variables between my CLI prompt and TeamCity Agent when executing the build but the only differences are the expected additions for TeamCity JRE and build numbers.
Am currently stuck trying to determine what magic makes the install work from an interactive CLI as opposed to TeamCity agent running as a Windows Service
The complete log referred to in the above log has details like
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'rebuild' ]
2 info using npm#6.4.1
3 info using node#v8.12.0
4 verbose run-script [ 'prerebuild', 'rebuild', 'postrebuild' ]
5 info lifecycle keccak#1.4.0~prerebuild: keccak#1.4.0
6 info lifecycle keccak#1.4.0~rebuild: keccak#1.4.0
7 verbose lifecycle keccak#1.4.0~rebuild: unsafe-perm in lifecycle true
8 verbose lifecycle keccak#1.4.0~rebuild: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\IR\my-corp-app\TcBuild\src\my-corp-app-node\node_modules\keccak\node_modules\.bin;D:\IR\my-corp-app\TcBuild\src\my-corp-app-node\node_modules\.bin;C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\IR\my-corp-app\TcBuild\src\my-corp-app-node\node_modules\keccak\node_modules\.bin;D:\IR\my-corp-app\TcBuild\src\my-corp-app-node\node_modules\.bin;C:\Windows\Microsoft.NET\Framework64\v4.0.30319\;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Amazon\cfn-bootstrap\;C:\ProgramData\chocolatey\bin;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\;C:\Program Files\dotnet\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn\;D:\apps\jdbc;C:\Program Files\Git\cmd;D:\apps\OpenSSL-Win64\bin;C:\Program Files\nodejs\;C:\Users\teamcity_user\AppData\Local\Microsoft\WindowsApps;C:\Users\teamcity_user\AppData\Roaming\npm;C:\Users\teamcity_user\.dotnet\tools
9 verbose lifecycle keccak#1.4.0~rebuild: CWD: D:\IR\my-corp-app\TcBuild\src\my-corp-app-node\node_modules\keccak
10 silly lifecycle keccak#1.4.0~rebuild: Args: [ '/d /s /c', 'node-gyp rebuild' ]
11 silly lifecycle keccak#1.4.0~rebuild: Returned: code: 1 signal: null
12 info lifecycle keccak#1.4.0~rebuild: Failed to exec rebuild script
13 verbose stack Error: keccak#1.4.0 rebuild: `node-gyp rebuild`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at EventEmitter.emit (events.js:214:7)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at ChildProcess.emit (events.js:214:7)
13 verbose stack at maybeClose (internal/child_process.js:915:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid keccak#1.4.0
15 verbose cwd D:\IR\my-corp-app\TcBuild\src\my-corp-app-node\node_modules\keccak
16 verbose Windows_NT 10.0.14393
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "rebuild"
18 verbose node v8.12.0
19 verbose npm v6.4.1
20 error code ELIFECYCLE
21 error errno 1
22 error keccak#1.4.0 rebuild: `node-gyp rebuild`
22 error Exit status 1
23 error Failed at the keccak#1.4.0 rebuild script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Finally solved this by adding an inserting extra (and redundant) PowerShell build step:
Runner Type: PowerShell
Script: SourceCode
Working directory: <the obvious folder>
Script Source: npm install
and it magically worked.
Now, of course I already was executing npm install from deep down inside my build automation build.ps1.
For some reason, the above works and the buried one doesn't. I can't explain why. Confirmed that the execution folder was correct and also used get-command npm from both contexts and the result was the same for both:
CommandType Name Version Source
----------- ---- ------- ------
Application npm.cmd 0.0.0.0 C:\Program Files\nodejs\npm.cmd

NPM fails when installing image-webpack-loader. I can't proceed with my project.

Webpack was working fine all day and when I added a new image it suddenly failed. I updated node and npm and I still get the following error. How would I go about fixing this or using an alternative? The other image loader modules I attempted to install give the same error.
74857 verbose stack Error: gifsicle#3.0.4 postinstall: `node lib/install.js`
74857 verbose stack Exit status 1
74857 verbose stack at EventEmitter.<anonymous> (C:\Users\mykod\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.js:279:16)
74857 verbose stack at emitTwo (events.js:106:13)
74857 verbose stack at EventEmitter.emit (events.js:191:7)
74857 verbose stack at ChildProcess.<anonymous> (C:\Users\mykod\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.js:40:14)
74857 verbose stack at emitTwo (events.js:106:13)
74857 verbose stack at ChildProcess.emit (events.js:191:7)
74857 verbose stack at maybeClose (internal/child_process.js:877:16)
74857 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
74858 verbose pkgid gifsicle#3.0.4
74859 verbose cwd C:\Users\mykod\Desktop\best-voted
74860 error Windows_NT 10.0.14393
74861 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\mykod\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
74862 error node v6.9.4
74863 error npm v4.3.0
74864 error code ELIFECYCLE
74865 error errno 1
74866 error gifsicle#3.0.4 postinstall: `node lib/install.js`
74866 error Exit status 1
74867 error Failed at the gifsicle#3.0.4 postinstall script 'node lib/install.js'.
74867 error Make sure you have the latest version of node.js and npm installed.
74867 error If you do, this is most likely a problem with the gifsicle package,
74867 error not with npm itself.
74867 error Tell the author that this fails on your system:
74867 error node lib/install.js
74867 error You can get information on how to open an issue for this project with:
74867 error npm bugs gifsicle
74867 error Or if that isn't available, you can get their info via:
74867 error npm owner ls gifsicle
74867 error There is likely additional logging output above.
74868 verbose exit [ 1, true ]
Restarting doesn't help for me. There was problems with permissions on my laptop.
I'm working on Ubuntu 16.04.
Here is solution: fixing npm permissions
I'm recommending to watch video first.
At least check NPM's directory first npm config get prefix and if it's /usr, you have to use Option 2.
I've solved this problems with processing step by step of Option 2.
I restarted my computer and was able to install it. Windows.