audreyt / node-webworker-threads

Lightweight Web Worker API implementation with native threads
https://npmjs.org/package/webworker-threads
Other
2.3k stars 149 forks source link

node-gyp EACCES infinite loop Error during install? #124

Closed MasterJames closed 8 years ago

MasterJames commented 8 years ago

I had done this first npm install -g node-gyp

but doing npm install webworker-threads --save

Results with this infinite loop warning?

gyp WARN EACCES attempting to reinstall using temporary dev dir "node_modules/webworker-threads/.node-gyp"
gyp WARN EACCES user "root" does not have permission to access the dev dir "node_modules/webworker-threads/.node-gyp/6.9.1"

I CTRL-BRK out of. I tried making the directory mkdir -p but it's parent .node-gyp is deleted after same error.

npm ERR! Linux 4.4.0-43-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "webworker-threads" "--save"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! path node_modules/.staging/webworker-threads-299a42de
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall rename

npm ERR! Error: EACCES: permission denied, rename 'node_modules/.staging/webworker-threads-299a42de' -> node_modules/webworker-threads'
npm ERR!     at whenOldMovedAway (/usr/local/lib/node_modules/npm/lib/install/action/finalize.js:43:5)
npm ERR!     at /usr/local/lib/node_modules/npm/lib/utils/rename.js:13:14
npm ERR!     at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR!
npm ERR! Error: EACCES: permission denied, rename 'node_modules/.staging/webworker-threads-299a42de' -> 'node_modules/webworker-threads'
npm ERR!     at Error (native)
npm ERR!  { Error: EACCES: permission denied, rename 'node_modules/.staging/webworker-threads-299a42de' -> 'node_modules/webworker-threads'
npm ERR!     at whenOldMovedAway (/usr/local/lib/node_modules/npm/lib/install/action/finalize.js:43:5)
npm ERR!     at /usr/local/lib/node_modules/npm/lib/utils/rename.js:13:14
npm ERR!     at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR!
npm ERR! Error: EACCES: permission denied, rename 'node_modules/.staging/webworker-threads-299a42de' -> 'node_modules/webworker-threads'
npm ERR!     at Error (native) parent: 'mds-node' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!    npm-debug.log

I am always root via sudo su, (and assign permissions, etc. as needed.) [Alas the parent folder, is mounted over NFS, which has never been a problem.]

{ seems there are some things still I could explore for solutions to the cause of this odd problem ? } _[removing --save wasn't one of them, nor chown -R root node_modules/ ]_

MasterJames commented 8 years ago

if no NFS, and therefore copied to Ubuntu Server latest VM.

gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/6.9.1"
gyp WARN EACCES attempting to reinstall using temporary dev dir "node_modules/webworker-threads/.node-gyp"
make: Entering directory 'node_modules/webworker-threads/build'
  CXX(target) Release/obj.target/WebWorkerThreads/src/WebWorkerThreads.o
In file included from ../src/WebWorkerThreads.cc:17:0:
../src/bson.cc: In member function ‘v8::Local<v8::Value> BSONDeserializer::DeserializeDocumentInternal(bool)’:
../src/bson.cc:429:37: warning: ‘bool v8::Object::ForceSet(v8::Local<v8::Value>, v8::Local<v8::Value>, v8::PropertyAttribute)’ is deprecated: Use CreateDataProperty / DefineOwnProperty [-Wdeprecated-declarations]
   returnObject->ForceSet(name, value);
MasterJames commented 8 years ago

Either a user or root both get the same error above, which ends like this below.

In file included from /home/serveruser/.node-gyp/6.9.1/include/node/v8.h:25:0,
                 from ../src/WebWorkerThreads.cc:5:
/home/serveruser/.node-gyp/6.9.1/include/node/v8.h:4664:69: note: declared here
   static V8_DEPRECATED("Use isolate version", Local<ObjectTemplate> New());
                                                                     ^
/home/serveruser/.node-gyp/6.9.1/include/node/v8config.h:333:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^
  SOLINK_MODULE(target) Release/obj.target/WebWorkerThreads.node
  COPY Release/WebWorkerThreads.node
make: Leaving directory 'node_modules/webworker-threads/build'
mds-node@1.0.0 /MasterDomain2/Code/mds-node
└─┬ webworker-threads@0.7.8
  └── bindings@1.2.1

Wait a minute I see it seems to have installed, it has to be native FS and can't be root during install, but runs as root after.

Maybe there is some simple work to improve those issues, and worth looking into, or if anybody reading has a clue what either issues have a solution. I'm not clear on the C and node-gyp stuff.