npm install not working

npm install not working

by Conn Warwicker -
Number of replies: 1
Picture of Core developers Picture of Plugin developers

I followed the instructions here to install the node and npm version moodle supports (lts/carbon): https://github.com/nodejs/help/wiki/Installation

When I cd into my moodle web directory and run "npm install" I get hundreds of warnings saying:

npm WARN tar EPERM: operation not permitted, futime

And then it gives me an error at the end:

npm ERR! path /var/www/html/node_modules/acorn-jsx/node_modules/acorn

npm ERR! code ENOENT

npm ERR! errno -2

npm ERR! syscall rename

npm ERR! enoent ENOENT: no such file or directory, rename '/var/www/html/node_modules/acorn-jsx/node_modules/acorn' -> '/var/www/html/node_modules/acorn-jsx/node_modules/.acorn.DELETE'

npm ERR! enoent This is related to npm not being able to find a file.

npm ERR! enoent


If i run it as sudo I get this output:

npm WARN rollback Rolling back babel-code-frame@6.26.0 failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/var/www/html/node_modules/babel-code-frame/package.json.445969874'

npm WARN rollback Rolling back espree@3.5.4 failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/var/www/html/node_modules/espree/package.json.2856561564'

npm WARN rollback Rolling back glob@3.2.11 failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/var/www/html/node_modules/fileset/node_modules/glob/package.json.3839151945'

npm WARN rollback Rolling back eslint@4.6.1 failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/var/www/html/node_modules/eslint/package.json.1999670836'

npm WARN rollback Rolling back gear-lib@0.8.15 failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/var/www/html/node_modules/gear-lib/package.json.1958284874'

npm WARN rollback Rolling back cli@0.6.6 failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/var/www/html/node_modules/cli/package.json.2487831838'

npm WARN rollback Rolling back acorn-jsx@3.0.1 failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/var/www/html/node_modules/acorn-jsx/package.json.3484557133'

npm WARN ajv-keywords@3.4.0 requires a peer of ajv@^6.9.1 but none is installed. You must install peer dependencies yourself.

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: source-map@0.1.43 (node_modules/handlebars/node_modules/source-map):

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ETXTBSY: text file is busy, rename '/var/www/html/node_modules/handlebars/node_modules/source-map/package.json.2274299368' -> '/var/www/html/node_modules/handlebars/node_modules/source-map/package.json'

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: uglify-js@2.3.6 (node_modules/handlebars/node_modules/uglify-js):

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ETXTBSY: text file is busy, rename '/var/www/html/node_modules/handlebars/node_modules/uglify-js/package.json.3062259584' -> '/var/www/html/node_modules/handlebars/node_modules/uglify-js/package.json'

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: async@0.2.10 (node_modules/handlebars/node_modules/async):

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ETXTBSY: text file is busy, rename '/var/www/html/node_modules/handlebars/node_modules/async/package.json.2836546501' -> '/var/www/html/node_modules/handlebars/node_modules/async/package.json'


npm ERR! path /var/www/html/node_modules/acorn-jsx/node_modules/acorn/package.json.2333148686

npm ERR! code ENOENT

npm ERR! errno -2

npm ERR! syscall open

npm ERR! enoent ENOENT: no such file or directory, open '/var/www/html/node_modules/acorn-jsx/node_modules/acorn/package.json.2333148686'

npm ERR! enoent This is related to npm not being able to find a file.


I've uninstalled and reinstalled node and npm several times, googled everything I can think of, it's just getting very frustrating now. All I want to do is run the grunt amd minify script and i'm just getting endless errors..

Anyone know how to fix this?

Thanks.


Average of ratings: -
In reply to Conn Warwicker

Re: npm install not working

by Conn Warwicker -
Picture of Core developers Picture of Plugin developers
Think it's working now. It appears to have been an issue with my vagrant/virtualbox setup, where npm install just simply doesn't work on a synced folder.

Had to copy the whole web directory into one which wasn't shared between guest and host, then run it in there, then copy it all back.

What a pain.
Average of ratings: Useful (1)