question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to run npm ci on Windows with latest version of master branch

See original GitHub issue

Because I go back and forth between the master branch (to test PRs hitting master) and next-curriculum (to work on the project-based curriculum), sometimes in the same day I will go back and forth 2-3 times. As recent as two days ago, I was able to successfully run npm ci and npm run develop on the latest master branch with no issues.

I am not exactly sure what PR merged to cause me trouble on my Windows machine, but even after doing the following:

cp sample.env .env
npm run clean
npm ci

I still get the error shown at the bottom after npm ci executes. I even tried deleting the repo locally, re-cloning it, and following all the docs steps again, but still get the error. It seems to be related to node-gyp.

OPT@HP-PC MINGW64 /d/coding/fcc (master)
$ npm run clean

> @freecodecamp/freecodecamp@0.0.1 clean D:\coding\fcc
> npm-run-all clean:client clean:server clean:packages


> @freecodecamp/freecodecamp@0.0.1 clean:client D:\coding\fcc
> cd ./client && npm run clean

The system cannot find the path specified.

> @freecodecamp/client@1.0.0 clean D:\Coding\fcc\client
> gatsby clean

info Deleting .cache, public
info Successfully deleted directories

> @freecodecamp/freecodecamp@0.0.1 clean:server D:\coding\fcc
> shx rm -rf ./api-server/lib


> @freecodecamp/freecodecamp@0.0.1 clean:packages D:\coding\fcc
> lerna clean -y

lerna notice cli v3.22.0
lerna info versioning independent
lerna info clean removing D:\coding\fcc\api-server\node_modules
lerna info clean removing D:\coding\fcc\client\node_modules
lerna info clean removing D:\coding\fcc\client\plugins\fcc-source-challenges\node_modules
lerna info clean removing D:\coding\fcc\client\plugins\gatsby-remark-fcc-forum-emoji\node_modules
lerna info clean removing D:\coding\fcc\client\plugins\gatsby-remark-node-identity\node_modules
lerna info clean removing D:\coding\fcc\curriculum\node_modules
lerna info clean removing D:\coding\fcc\search-indexing\node_modules
lerna info clean removing D:\coding\fcc\tools\challenge-md-parser\node_modules
lerna info clean removing D:\coding\fcc\tools\scripts\build\node_modules
lerna info clean removing D:\coding\fcc\tools\scripts\seed\node_modules
lerna success clean finished

OPT@HP-PC MINGW64 /d/coding/fcc (master)
$ npm ci
npm WARN prepare removing existing node_modules/ before installation

> fsevents@1.2.12 install D:\coding\fcc\node_modules\fsevents
> node-gyp rebuild


D:\coding\fcc\node_modules\fsevents>if not defined npm_config_node_gyp (node "C:\Users\OPT\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Users\OPT\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Traceback (most recent call last):
  File "C:\Users\OPT\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py", line 50, in <module>
    sys.exit(gyp.script_main())
  File "C:\Users\OPT\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 554, in script_main
    return main(sys.argv[1:])
  File "C:\Users\OPT\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 547, in main
    return gyp_main(args)
  File "C:\Users\OPT\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 532, in gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "C:\Users\OPT\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 2030, in GenerateOutput
    sln_projects, project_objects, flat=msvs_version.FlatSolution())
  File "C:\Users\OPT\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 1787, in _GatherSolutionFolders
    return _DictsToFolders('', root, flat)
  File "C:\Users\OPT\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 1740, in _DictsToFolders
    for folder, contents in bucket.items():
AttributeError: 'MSVSProject' object has no attribute 'items'
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Users\OPT\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:311:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\OPT\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\coding\fcc\node_modules\fsevents
gyp ERR! node -v v12.16.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok

> husky@4.2.5 install D:\coding\fcc\node_modules\husky
> node husky install

husky > Setting up git hooks
husky > Done

> husky@4.2.5 postinstall D:\coding\fcc\node_modules\husky
> opencollective-postinstall || exit 0

Thank you for using husky!
If you rely on this package, please consider supporting our open collective:
> https://opencollective.com/husky/donate


> core-js-pure@3.6.5 postinstall D:\coding\fcc\node_modules\core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> docsify@4.11.3 postinstall D:\coding\fcc\node_modules\docsify
> opencollective-postinstall

Thank you for using docsify!
If you rely on this package, please consider supporting our open collective:
> https://opencollective.com/docsify/donate


> cypress@4.11.0 postinstall D:\coding\fcc\node_modules\cypress
> node index.js --exec install

Note: Skipping binary installation: Environment variable CYPRESS_INSTALL_BINARY = 0.


> @freecodecamp/freecodecamp@0.0.1 postinstall D:\coding\fcc
> npm run bootstrap

The system cannot find the path specified.

> @freecodecamp/freecodecamp@0.0.1 bootstrap D:\coding\fcc
> lerna bootstrap --ci

lerna notice cli v3.22.0
lerna info versioning independent
lerna info ci enabled
lerna info Bootstrapping 10 packages
lerna info Installing external dependencies
lerna ERR! npm ci exited 4294963245 in '@freecodecamp/curriculum'
lerna ERR! npm ci stderr:
The system cannot find the path specified.
npm WARN tarball tarball data for npm@6.14.7 (sha512-swhsdpNpyXg4GbM6LpOQ6qaloQuIKizZ+Zh6JPXJQc59ka49100Js0WvZx594iaKSoFgkFq2s8uXFHS3/Xy2WQ==) seems to be corrupted. Trying one more time.
npm WARN tar ENOENT: no such file or directory, open 'D:\coding\fcc\curriculum\node_modules\npm\node_modules\fs-write-stream-atomic\.npmignore'
npm WARN tar ENOENT: no such file or directory, open 'D:\coding\fcc\curriculum\node_modules\npm\node_modules\function-bind\.npmignore'
npm WARN tar ENOENT: no such file or directory, open 'D:\coding\fcc\curriculum\node_modules\npm\node_modules\ip\.npmignore'
npm WARN tar ENOENT: no such file or directory, open 'D:\coding\fcc\curriculum\node_modules\npm\node_modules\object.getownpropertydescriptors\.npmignore'
npm WARN tar ENOENT: no such file or directory, open 'D:\coding\fcc\curriculum\node_modules\npm\node_modules\promise-retry\.npmignore'
npm WARN tar ENOENT: no such file or directory, open 'D:\coding\fcc\curriculum\node_modules\npm\node_modules\promzard\.npmignore'
npm WARN tar ENOENT: no such file or directory, open 'D:\coding\fcc\curriculum\node_modules\npm\node_modules\sorted-union-stream\node_modules\string_decoder\.npmignore'
npm WARN tar ENOENT: no such file or directory, open 'D:\coding\fcc\curriculum\node_modules\npm\node_modules\verror\.npmignore'
npm WARN tar ENOENT: no such file or directory, open 'D:\coding\fcc\curriculum\node_modules\npm\node_modules\is-symbol\.nvmrc'
npm WARN tar ENOENT: no such file or directory, open 'D:\coding\fcc\curriculum\node_modules\npm\node_modules\es-abstract\.nycrc'
npm WARN tar ENOENT: no such file or directory, open 'D:\coding\fcc\curriculum\node_modules\npm\node_modules\performance-now\.tm_properties'
npm WARN tar ENOENT: no such file or directory, open 'D:\coding\fcc\curriculum\node_modules\npm\node_modules\json-schema\draft-03\examples\calendar'
npm WARN tar ENOENT: no such file or directory, open 'D:\coding\fcc\curriculum\node_modules\npm\node_modules\json-schema\draft-03\examples\card'
npm WARN tar ENOENT: no such file or directory, open 'D:\coding\fcc\curriculum\node_modules\npm\node_modules\umask\ChangeLog'
npm WARN tar ENOENT: no such file or directory, open 'D:\coding\fcc\curriculum\node_modules\npm\node_modules\json-schema\draft-03\examples\geo'
npm WARN tar ENOENT: no such file or directory, open 'D:\coding\fcc\curriculum\node_modules\npm\node_modules\json-schema\draft-03\examples\interfaces'
npm WARN tar ENOENT: no such file or directory, open 'D:\coding\fcc\curriculum\node_modules\npm\node_modules\json-schema\draft-00\json-ref'
npm WARN tar ENOENT: no such file or directory, open 'D:\coding\fcc\curriculum\node_modules\npm\node_modules\json-schema\draft-01\json-ref'
npm WARN tar ENOENT: no such file or directory, open 'D:\coding\fcc\curriculum\node_modules\npm\node_modules\json-schema\draft-02\json-ref'
npm WARN tar ENOENT: no such file or directory, open 'D:\coding\fcc\curriculum\node_modules\npm\node_modules\json-schema\draft-03\json-ref'
npm WARN tar ENOENT: no such file or directory, open 'D:\coding\fcc\curriculum\node_modules\npm\node_modules\xtend\LICENCE'
npm ERR! code ENOTEMPTY
npm ERR! syscall rmdir
npm ERR! path D:\coding\fcc\curriculum\node_modules\npm\node_modules
npm ERR! errno -4051
npm ERR! ENOTEMPTY: directory not empty, rmdir 'D:\coding\fcc\curriculum\node_modules\npm\node_modules'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\OPT\AppData\Roaming\npm-cache\_cacache\_logs\2020-08-04T23_06_41_266Z-debug.log

lerna ERR! npm ci exited 4294963245 in '@freecodecamp/curriculum'
lerna WARN complete Waiting for 2 child processes to exit. CTRL-C to exit immediately.
npm ERR! code ELIFECYCLE
npm ERR! errno 4294963245
npm ERR! @freecodecamp/freecodecamp@0.0.1 bootstrap: `lerna bootstrap --ci`
npm ERR! Exit status 4294963245
npm ERR!
npm ERR! Failed at the @freecodecamp/freecodecamp@0.0.1 bootstrap 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\OPT\AppData\Roaming\npm-cache\_cacache\_logs\2020-08-04T23_07_30_281Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 4294963245
npm ERR! @freecodecamp/freecodecamp@0.0.1 postinstall: `npm run bootstrap`
npm ERR! Exit status 4294963245
npm ERR!
npm ERR! Failed at the @freecodecamp/freecodecamp@0.0.1 postinstall 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\OPT\AppData\Roaming\npm-cache\_logs\2020-08-04T23_07_30_335Z-debug.log

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:21 (21 by maintainers)

github_iconTop GitHub Comments

1reaction
RandellDawsoncommented, Aug 25, 2020

OK. I guess it was a combination of errors. Once I cherry-picked the commits on #39454 into a branch off master where the changes @lasjorg suggested, everything is working again on my Windows machine.

@Twaha-Rahman Thanks for the help.

@lasjorg If you want to create a PR with your suggested bumps, I think we can get those changes merged quickly.

1reaction
RandellDawsoncommented, Aug 25, 2020

@Twaha-Rahman Sure. I will do that now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

freeCodeCamp local installation: npm ci is hanging
I get the following error when running npm run test with the most recent version of the master branch on Windows.
Read more >
What is the difference between "npm install" and "npm ci"?
npm install is the command used to install the dependencies listed in a project's package.json file, while npm ci ...
Read more >
Should you run npm install again after doing git checkout?
It depends on the changes made to a specific project. Once you checkout to a remote branch, always make sure that you always...
Read more >
sqlite3 - npm
Latest version : 5.1.4, last published: 12 days ago. Start using sqlite3 in your project by running `npm i sqlite3`.
Read more >
Troubleshoot pipeline runs - Azure DevOps - Microsoft Learn
UI settings override YAML trigger setting; Pull request triggers not supported with Azure Repos; Branch filters misconfigured in CI and PR ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found