JoshuaWise / integer

Native 64-bit integers with overflow protection.
MIT License
19 stars 9 forks source link

Installation error - Cannot read property 'loaded' of undefined #28

Closed danilolr closed 4 years ago

danilolr commented 4 years ago

I am with a error on the install of integer library.

The error is :

` sh: 1: prebuild-install: Permission denied Error: EACCES: permission denied, scandir '/root/test/node_modules/integer' TypeError: Cannot read property 'get' of undefined at errorMessage (/opt/node/lib/node_modules/npm/lib/utils/error-message.js:38:39) at errorHandler (/opt/node/lib/node_modules/npm/lib/utils/error-handler.js:201:13) at /opt/node/lib/node_modules/npm/bin/npm-cli.js:78:20 at cb (/opt/node/lib/node_modules/npm/lib/npm.js:225:22) at /opt/node/lib/node_modules/npm/lib/npm.js:263:24 at /opt/node/lib/node_modules/npm/lib/config/core.js:81:7 at Array.forEach () at /opt/node/lib/node_modules/npm/lib/config/core.js:80:13 at f (/opt/node/lib/node_modules/npm/node_modules/once/once.js:25:25) at /opt/node/lib/node_modules/npm/lib/config/core.js:110:20 TypeError: Cannot read property 'loaded' of undefined at exit (/opt/node/lib/node_modules/npm/lib/utils/error-handler.js:97:27) at process.errorHandler (/opt/node/lib/node_modules/npm/lib/utils/error-handler.js:216:3) at process.emit (events.js:311:20) at processPromiseRejections (internal/process/promises.js:209:33) at processTicksAndRejections (internal/process/task_queues.js:98:32) /opt/node/lib/node_modules/npm/lib/utils/error-handler.js:97 var doExit = npm.config.loaded ? npm.config.get('_exit') : true ^

TypeError: Cannot read property 'loaded' of undefined at exit (/opt/node/lib/node_modules/npm/lib/utils/error-handler.js:97:27) at process.errorHandler (/opt/node/lib/node_modules/npm/lib/utils/error-handler.js:216:3) at process.emit (events.js:311:20) at process._fatalException (internal/process/execution.js:164:25) npm WARN test@1.0.0 No description npm WARN test@1.0.0 No repository field.

npm ERR! code ELIFECYCLE npm ERR! errno 7 npm ERR! integer@3.0.1 install: prebuild-install || npm run build-release npm ERR! Exit status 7 npm ERR! npm ERR! Failed at the integer@3.0.1 install 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! /root/.npm/_logs/2020-04-07T15_43_40_535Z-debug.log

` To reproduce the error I created a Docker file

` FROM ubuntu RUN mkdir /root/test WORKDIR /root/test RUN apt-get update RUN apt-get -y install xz-utils wget RUN wget https://nodejs.org/dist/v12.16.1/node-v12.16.1-linux-x64.tar.xz RUN tar xf node-v12.16.1-linux-x64.tar.xz RUN mv node-v12.16.1-linux-x64 /opt/node ENV PATH="/opt/node/bin:${PATH}" RUN rm node-v12.16.1-linux-x64.tar.xz -rf RUN npm i -g node-gyp@latest RUN npm init -y RUN cat package.json RUN npm install integer --save

`

Run it with :

docker build .

to see the error.

On the docker file I already have the npm i -g node-gyp@latest command as suggested on another issues.

JoshuaWise commented 4 years ago

Try upgrading to version 4.0.0