Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Introducing the Practice

npm install errors

How can I get rid of all these Errors I'm getting in my terminal while using 'npm install'?

I'm still able to run the application on my local port though.

-----> practice course <----- https://teamtreehouse.com/library/practice-state-in-react -----> practice course <-----

Imgur

2 Answers

Robert Manolis
STAFF
Robert Manolis
Treehouse Guest Teacher

Hi Alexander Stratev, I just tested this and I didn't get any of the errors. I downloaded the files from the first video. Opened them in VSCode. Ran npm ci to install. And no errors. If you follow that same process and get errors, I would recommend checking that you have the Latest Stable Version of Node and npm installed. :thumbsup:

Thanks for the response. But it is weird that I was able to launch the app.

Robert Manolis I followed the steps in the video (downloaded the project files, opened them in VSC, cd practice-state, npm install) and I got A LOT of errors, just like Alexander Stratev said...

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
Daniel-Cran-MacBook-Air-2:practice-state-in-react danielcranney1$ cd practice-state
Daniel-Cran-MacBook-Air-2:practice-state danielcranney1$ npm install

> fsevents@1.2.4 install /Users/danielcranney1/Google Drive/03 WORK/Freelance/2020/Development/Learning/React/practice-state-in-react/practice-state/node_modules/fsevents
> node install

node-pre-gyp WARN Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.2.4/fse-v1.2.4-node-v83-darwin-x64.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for fsevents@1.2.4 and node@14.15.4 (node-v83 ABI, unknown) (falling back to source compile with node-gyp) 
  SOLINK_MODULE(target) Release/.node
  CXX(target) Release/obj.target/fse/fsevents.o
In file included from ../fsevents.cc:6:
In file included from ../../nan/nan.h:221:
In file included from ../../nan/nan_converters.h:67:
../../nan/nan_converters_43_inl.h:22:1: error: no viable conversion from 'Local<v8::Context>' to 'v8::Isolate *'
X(Boolean)
^~~~~~~~~~
../../nan/nan_converters_43_inl.h:18:23: note: expanded from macro 'X'
      val->To ## TYPE(isolate->GetCurrentContext())                            \
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:2848:37: note: passing argument to parameter 'isolate' here
  Local<Boolean> ToBoolean(Isolate* isolate) const;
                                    ^
In file included from ../fsevents.cc:6:
In file included from ../../nan/nan.h:221:
In file included from ../../nan/nan_converters.h:67:
../../nan/nan_converters_43_inl.h:40:1: error: no viable conversion from 'Local<v8::Context>' to 'v8::Isolate *'
X(bool, Boolean)
^~~~~~~~~~~~~~~~
../../nan/nan_converters_43_inl.h:37:29: note: expanded from macro 'X'
  return val->NAME ## Value(isolate->GetCurrentContext());                     \
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:2858:30: note: passing argument to parameter 'isolate' here
  bool BooleanValue(Isolate* isolate) const;
                             ^
In file included from ../fsevents.cc:6:
In file included from ../../nan/nan.h:222:
In file included from ../../nan/nan_new.h:189:
../../nan/nan_implementation_12_inl.h:103:42: error: no viable conversion from 'v8::Isolate *' to 'Local<v8::Context>'
  return scope.Escape(v8::Function::New( isolate
                                         ^~~~~~~
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:190:7: note: candidate constructor (the implicit copy constructor) not viable: no
      known conversion from 'v8::Isolate *' to 'const v8::Local<v8::Context> &' for 1st argument
class Local {
      ^
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:190:7: note: candidate constructor (the implicit move constructor) not viable: no
      known conversion from 'v8::Isolate *' to 'v8::Local<v8::Context> &&' for 1st argument
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:194:13: note: candidate template ignored: could not match 'Local<type-parameter-0-0>'
      against 'v8::Isolate *'
  V8_INLINE Local(Local<S> that)
            ^
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:4446:22: note: passing argument to parameter 'context' here
      Local<Context> context, FunctionCallback callback,
                     ^
In file included from ../fsevents.cc:6:
../../nan/nan.h:1064:53: error: no viable conversion from 'v8::Isolate *' to 'Local<v8::Context>'
      v8::Local<v8::String> string = from->ToString(v8::Isolate::GetCurrent());
                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:190:7: note: candidate constructor (the implicit copy constructor) not viable: no
      known conversion from 'v8::Isolate *' to 'const v8::Local<v8::Context> &' for 1st argument
class Local {
      ^
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:190:7: note: candidate constructor (the implicit move constructor) not viable: no
      known conversion from 'v8::Isolate *' to 'v8::Local<v8::Context> &&' for 1st argument
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:194:13: note: candidate template ignored: could not match 'Local<type-parameter-0-0>'
      against 'v8::Isolate *'
  V8_INLINE Local(Local<S> that)
            ^
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:2811:22: note: passing argument to parameter 'context' here
      Local<Context> context) const;
                     ^
In file included from ../fsevents.cc:6:
../../nan/nan.h:1855:28: error: no matching member function for call to 'Set'
    New(persistentHandle)->Set(New(key).ToLocalChecked(), value);
    ~~~~~~~~~~~~~~~~~~~~~~~^~~
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:3670:37: note: candidate function not viable: requires 3 arguments, but 2 were
      provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:3673:37: note: candidate function not viable: requires 3 arguments, but 2 were
      provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
In file included from ../fsevents.cc:6:
../../nan/nan.h:1861:28: error: no matching member function for call to 'Set'
    New(persistentHandle)->Set(key, value);
    ~~~~~~~~~~~~~~~~~~~~~~~^~~
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:3670:37: note: candidate function not viable: requires 3 arguments, but 2 were
      provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:3673:37: note: candidate function not viable: requires 3 arguments, but 2 were
      provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
In file included from ../fsevents.cc:6:
../../nan/nan.h:1867:28: error: no matching member function for call to 'Set'
    New(persistentHandle)->Set(index, value);
    ~~~~~~~~~~~~~~~~~~~~~~~^~~
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:3670:37: note: candidate function not viable: requires 3 arguments, but 2 were
      provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:3673:37: note: candidate function not viable: requires 3 arguments, but 2 were
      provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
In file included from ../fsevents.cc:6:
../../nan/nan.h:1873:32: error: no matching member function for call to 'Get'
        New(persistentHandle)->Get(New(key).ToLocalChecked()));
        ~~~~~~~~~~~~~~~~~~~~~~~^~~
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:3717:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:3720:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
In file included from ../fsevents.cc:6:
../../nan/nan.h:1879:48: error: no matching member function for call to 'Get'
    return scope.Escape(New(persistentHandle)->Get(key));
                        ~~~~~~~~~~~~~~~~~~~~~~~^~~
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:3717:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:3720:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
In file included from ../fsevents.cc:6:
../../nan/nan.h:1884:48: error: no matching member function for call to 'Get'
    return scope.Escape(New(persistentHandle)->Get(index));
                        ~~~~~~~~~~~~~~~~~~~~~~~^~~
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:3717:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:3720:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
In file included from ../fsevents.cc:6:
In file included from ../../nan/nan.h:2698:
../../nan/nan_object_wrap.h:24:25: error: no member named 'IsNearDeath' in 'Nan::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >'
    assert(persistent().IsNearDeath());
           ~~~~~~~~~~~~ ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
                        ^
In file included from ../fsevents.cc:6:
In file included from ../../nan/nan.h:2698:
../../nan/nan_object_wrap.h:67:18: error: no member named 'MarkIndependent' in 'Nan::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >'
    persistent().MarkIndependent();
    ~~~~~~~~~~~~ ^
../../nan/nan_object_wrap.h:124:26: error: no member named 'IsNearDeath' in 'Nan::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >'
    assert(wrap->handle_.IsNearDeath());
           ~~~~~~~~~~~~~ ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
                        ^
In file included from ../fsevents.cc:6:
In file included from ../../nan/nan.h:2794:
../../nan/nan_typedarray_contents.h:34:43: warning: 'GetContents' is deprecated: Use GetBackingStore. See http://crbug.com/v8/9908.
      [-Wdeprecated-declarations]
      data   = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
                                          ^
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:5272:3: note: 'GetContents' has been explicitly marked deprecated here
  V8_DEPRECATE_SOON("Use GetBackingStore. See http://crbug.com/v8/9908.")
  ^
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8config.h:402:39: note: expanded from macro 'V8_DEPRECATE_SOON'
# define V8_DEPRECATE_SOON(message) [[deprecated(message)]]
                                      ^
../fsevents.cc:50:32: error: no template named 'Handle' in namespace 'v8'
    static void Initialize(v8::Handle<v8::Object> exports);
                           ~~~~^
../fsevents.cc:63:6: warning: field 'async_resource' will be initialized after field 'lockStarted' [-Wreorder-ctor]
   : async_resource("fsevents:FSEvents"), lockStarted(false) {
     ^
In file included from ../fsevents.cc:82:
../src/constants.cc:89:11: error: no matching member function for call to 'Set'
  object->Set(Nan::New<v8::String>("kFSEventStreamEventFlagNone").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagNone));
  ~~~~~~~~^~~
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:3670:37: note: candidate function not viable: requires 3 arguments, but 2 were
      provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:3673:37: note: candidate function not viable: requires 3 arguments, but 2 were
      provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
In file included from ../fsevents.cc:82:
../src/constants.cc:90:11: error: no matching member function for call to 'Set'
  object->Set(Nan::New<v8::String>("kFSEventStreamEventFlagMustScanSubDirs").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagMustScanSubDirs));
  ~~~~~~~~^~~
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:3670:37: note: candidate function not viable: requires 3 arguments, but 2 were
      provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:3673:37: note: candidate function not viable: requires 3 arguments, but 2 were
      provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
In file included from ../fsevents.cc:82:
../src/constants.cc:91:11: error: no matching member function for call to 'Set'
  object->Set(Nan::New<v8::String>("kFSEventStreamEventFlagUserDropped").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagUserDropped));
  ~~~~~~~~^~~
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:3670:37: note: candidate function not viable: requires 3 arguments, but 2 were
      provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:3673:37: note: candidate function not viable: requires 3 arguments, but 2 were
      provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
In file included from ../fsevents.cc:82:
../src/constants.cc:92:11: error: no matching member function for call to 'Set'
  object->Set(Nan::New<v8::String>("kFSEventStreamEventFlagKernelDropped").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagKernelDropped));
  ~~~~~~~~^~~
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:3670:37: note: candidate function not viable: requires 3 arguments, but 2 were
      provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:3673:37: note: candidate function not viable: requires 3 arguments, but 2 were
      provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
In file included from ../fsevents.cc:82:
../src/constants.cc:93:11: error: no matching member function for call to 'Set'
  object->Set(Nan::New<v8::String>("kFSEventStreamEventFlagEventIdsWrapped").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagEventIdsWrapped));
  ~~~~~~~~^~~
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:3670:37: note: candidate function not viable: requires 3 arguments, but 2 were
      provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/danielcranney1/Library/Caches/node-gyp/14.15.4/include/node/v8.h:3673:37: note: candidate function not viable: requires 3 arguments, but 2 were
      provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
2 warnings and 20 errors generated.
make: *** [Release/obj.target/fse/fsevents.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Darwin 19.6.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/danielcranney1/Google Drive/03 WORK/Freelance/2020/Development/Learning/React/practice-state-in-react/practice-state/node_modules/fsevents/lib/binding/Release/node-v83-darwin-x64/fse.node" "--module_name=fse" "--module_path=/Users/danielcranney1/Google Drive/03 WORK/Freelance/2020/Development/Learning/React/practice-state-in-react/practice-state/node_modules/fsevents/lib/binding/Release/node-v83-darwin-x64" "--napi_version=7" "--node_abi_napi=napi"
gyp ERR! cwd /Users/danielcranney1/Google Drive/03 WORK/Freelance/2020/Development/Learning/React/practice-state-in-react/practice-state/node_modules/fsevents
gyp ERR! node -v v14.15.4
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/danielcranney1/Google Drive/03 WORK/Freelance/2020/Development/Learning/React/practice-state-in-react/practice-state/node_modules/fsevents/lib/binding/Release/node-v83-darwin-x64/fse.node --module_name=fse --module_path=/Users/danielcranney1/Google Drive/03 WORK/Freelance/2020/Development/Learning/React/practice-state-in-react/practice-state/node_modules/fsevents/lib/binding/Release/node-v83-darwin-x64 --napi_version=7 --node_abi_napi=napi' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/danielcranney1/Google Drive/03 WORK/Freelance/2020/Development/Learning/React/practice-state-in-react/practice-state/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1048:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
node-pre-gyp ERR! System Darwin 19.6.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/danielcranney1/Google Drive/03 WORK/Freelance/2020/Development/Learning/React/practice-state-in-react/practice-state/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/danielcranney1/Google Drive/03 WORK/Freelance/2020/Development/Learning/React/practice-state-in-react/practice-state/node_modules/fsevents
node-pre-gyp ERR! node -v v14.15.4
node-pre-gyp ERR! node-pre-gyp -v v0.10.0
node-pre-gyp ERR! not ok 
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/danielcranney1/Google Drive/03 WORK/Freelance/2020/Development/Learning/React/practice-state-in-react/practice-state/node_modules/fsevents/lib/binding/Release/node-v83-darwin-x64/fse.node --module_name=fse --module_path=/Users/danielcranney1/Google Drive/03 WORK/Freelance/2020/Development/Learning/React/practice-state-in-react/practice-state/node_modules/fsevents/lib/binding/Release/node-v83-darwin-x64 --napi_version=7 --node_abi_napi=napi' (1)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 install: `node install`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

added 1698 packages from 661 contributors and audited 1766 packages in 77.405s
found 2789 vulnerabilities (1752 low, 26 moderate, 1009 high, 2 critical)
  run `npm audit fix` to fix them, or `npm audit` for details
Daniel-Cran-MacBook-Air-2:practice-state danielcranney1$ 

It might be worth seeing if you can replicate this using the steps in the video, because they do seem to produce errors at the moment.

Update: I've tried the 'npm ci' steps you suggested (with and without doing cd my-app before) and i still get errors.