1

I have ignored these for weeks now, and they seem to be piling up. My node app and everything work fine, but just when I run npm install for any node package it tends to print these. I have tried a node update and cache clean but nothing seems to remove these errors whenever I install a new package. Nothing exciting here and lots of repetition, but the full output is here:

How can I remove these errors?

Here is an excerpt:

> fsevents@0.2.1 install /Users/natumyers/Desktop/mine/A.M.E.N.SQL-Stack/node_modules/chokidar/node_modules/fsevents
> node-gyp rebuild

  CXX(target) Release/obj.target/fse/fsevents.o
In file included from ../fsevents.cc:6:
../../nan/nan.h:339:13: error: no member named 'New' in 'v8::String'
    return  _NAN_ERROR(v8::Exception::Error, errmsg);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../nan/nan.h:319:50: note: expanded from macro '_NAN_ERROR'
# define _NAN_ERROR(fun, errmsg) fun(v8::String::New(errmsg))
                                     ~~~~~~~~~~~~^
../../nan/nan.h:343:5: error: no member named 'ThrowException' in namespace 'v8'
    _NAN_THROW_ERROR(v8::Exception::Error, errmsg);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../nan/nan.h:324:11: note: expanded from macro '_NAN_THROW_ERROR'
      v8::ThrowException(_NAN_ERROR(fun, errmsg));                             \
      ~~~~^
../../nan/nan.h:343:5: error: no member named 'New' in 'v8::String'
    _NAN_THROW_ERROR(v8::Exception::Error, errmsg);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../nan/nan.h:324:26: note: expanded from macro '_NAN_THROW_ERROR'
      v8::ThrowException(_NAN_ERROR(fun, errmsg));                             

Etcetera, and it continues to say:

                                       ^
/Users/natumyers/.node-gyp/5.2.0/include/node/node_buffer.h:36:40: note: candidate function not viable: requires 5 arguments, but 2 were provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
In file included from ../fsevents.cc:6:
../../nan/nan.h:420:12: error: no matching function for call to 'New'
    return node::Buffer::New(size);
           ^~~~~~~~~~~~~~~~~
/Users/natumyers/.node-gyp/5.2.0/include/node/node_buffer.h:28:40: note: candidate function not viable: requires 2 arguments, but 1 was provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate, size_t length);
                                       ^
/Users/natumyers/.node-gyp/5.2.0/include/node/node_buffer.h:31:40: note: candidate function not viable: requires at least 2 arguments, but 1 was provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
/Users/natumyers/.node-gyp/5.2.0/include/node/node_buffer.h:43:40: note: candidate function not viable: requires 3 arguments, but 1 was provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
/Users/natumyers/.node-gyp/5.2.0/include/node/node_buffer.h:36:40: note: candidate function not viable: requires 5 arguments, but 1 was provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
In file included from ../fsevents.cc:6:
../../nan/nan.h:427:26: error: no member named 'Use' in namespace 'node::Buffer'
    return node::Buffer::Use(data, size);
           ~~~~~~~~~~~~~~^
../../nan/nan.h:727:49: error: too few arguments to function call, single argument 'isolate' was not specified
    v8::Local<v8::Object> obj = v8::Object::New();
                                ~~~~~~~~~~~~~~~ ^
/Users/natumyers/.node-gyp/5.2.0/include/node/v8.h:2930:3: note: 'New' declared here
  static Local<Object> New(Isolate* isolate);
  ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
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:270:23)
gyp ERR! stack     at emitTwo (events.js:88:13)
gyp ERR! stack     at ChildProcess.emit (events.js:173:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:201:12)
gyp ERR! System Darwin 15.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/natumyers/Desktop/mine/A.M.E.N.SQL-Stack/node_modules/chokidar/node_modules/fsevents
gyp ERR! node -v v5.2.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 
npm WARN install:fsevents@0.2.1 fsevents@0.2.1 install: `node-gyp rebuild`
npm WARN install:fsevents@0.2.1 Exit status 1
rt-ym-seq@0.0.0 /Users/natumyers/Desktop/mine/A.M.E.N.SQL-Stack
├── UNMET PEER DEPENDENCY karma-chrome-launcher@~0.1.0
├── UNMET PEER DEPENDENCY karma-coffee-preprocessor@~0.1.0
├── UNMET PEER DEPENDENCY karma-firefox-launcher@~0.1.0
├── UNMET PEER DEPENDENCY karma-html2js-preprocessor@~0.1.0
├── UNMET PEER DEPENDENCY karma-phantomjs-launcher@~0.1.0
├── UNMET PEER DEPENDENCY karma-requirejs@~0.2.0
├── UNMET PEER DEPENDENCY karma-script-launcher@~0.1.0
└── passport-local@1.0.0 

npm WARN EPEERINVALID karma@0.10.10 requires a peer of karma-chrome-launcher@~0.1.0 but none was installed.
npm WARN EPEERINVALID karma@0.10.10 requires a peer of karma-coffee-preprocessor@~0.1.0 but none was installed.
npm WARN EPEERINVALID karma@0.10.10 requires a peer of karma-firefox-launcher@~0.1.0 but none was installed.
npm WARN EPEERINVALID karma@0.10.10 requires a peer of karma-html2js-preprocessor@~0.1.0 but none was installed.
npm WARN EPEERINVALID karma@0.10.10 requires a peer of karma-phantomjs-launcher@~0.1.0 but none was installed.
npm WARN EPEERINVALID karma@0.10.10 requires a peer of karma-requirejs@~0.2.0 but none was installed.
npm WARN EPEERINVALID karma@0.10.10 requires a peer of karma-script-launcher@~0.1.0 but none was installed.
npm WARN EPACKAGEJSON rt-ym-seq@0.0.0 No repository field.
npm WARN EPACKAGEJSON rt-ym-seq@0.0.0 No license field.
~~~
Zoe
  • 27,060
  • 21
  • 118
  • 148
Natu Myers
  • 486
  • 2
  • 4
  • 21
  • Possible duplicate of [Npm install not working. Same error on Pc and Mac](http://stackoverflow.com/questions/33864718/npm-install-not-working-same-error-on-pc-and-mac) – kenorb May 06 '16 at 13:18

1 Answers1

1

In cases where package.json was created times back, you get this error because you have upgraded the node version.

Downgrade the node version to whatever appropriate on which the package.json was created.

Here are steps to use older version of node

install nvm (node version manager)

brew install nvm for os-x

apt-get install nvm for ubuntu

yum install nvm for red-hat

considering you are on mac

Edit .bash_profile file to set NVM_DIR using sudo nano ~/.bash_profile

and append with

export NVM_DIR="$HOME/.nvm" . "$(brew --prefix nvm)/nvm.sh"

Open new terminal and install any specific node version

nvm install v.0.10.26

now try npm install you may not get the error if the node version is correct here.

veer7
  • 20,074
  • 9
  • 46
  • 74