kentcdodds / testing-workshop

A workshop for learning how to test JavaScript applications
http://git.io/testing-workshop
1.36k stars 708 forks source link

npm install #105

Closed kvedantmahajan closed 5 years ago

kvedantmahajan commented 5 years ago

I'm on branch fem-2018. Read the troubleshoot guide via other closed issues.

While running sudo npm run setup --silent I get

Error: Cannot find module 'node-darwin-x64/package.json'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
    at Function.resolve (internal/modules/cjs/helpers.js:30:19)
    at ChildProcess.<anonymous> (/Users/vedant/Projects/testing-workshop/node_modules/node-bin-setup/index.js:18:27)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:962:16)

My MacOs complies with all your project requirements.

Hope we can simplify something about it to get started at least!

And why does it requires sudo anyway? Without which the error is

Unhandled rejection Error: EACCES: permission denied, mkdir '/Users/xxx/.npm/_cacache/index-v5/c8/7f'

kentcdodds commented 5 years ago

Are you using the correct branch?

kvedantmahajan commented 5 years ago

As mentioned Kent, I'm using the branch fem-2018 as required. When I ran stepwise, sudo npm install is what fails.

kentcdodds commented 5 years ago

One thing to try, clone the repository, then remove this line from the package.json: https://github.com/kentcdodds/testing-workshop/blob/e7d3c22d7169c95e285a25afa0371bfd1971e89b/package.json#L63

Then try to run npm run setup and see whether that works for you.

kvedantmahajan commented 5 years ago

So this time it goes a few steps ahead . Installs in shared, server, client directories and then fails after starting install in /Users/vedant/Projects/testing-workshop/other/configuration/calculator.solution with error

Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/xxx/Projects/testing-workshop/other/configuration/calculator.solution/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node --module_name=fse --module_path=/Users/xxx/Projects/testing-workshop/other/configuration/calculator.solution/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64 --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)
kentcdodds commented 5 years ago

I'm sorry, I'm not sure what it could be. Seems like a problem with your setup. I'm afraid there's nothing more I can do to help.

kvedantmahajan commented 5 years ago

Interesting! It never happened with any repo I cloned before. Plus I've to use sudo in every command.

Anyway, I'll take the learnings from workshop I guess and try to implement in my project directly rather than this repo. Thanks for your time Kent.