pnp/docker-spfx

Error: EINVAL: invalid argument, open '/usr/app/spfx/node_modules/@microsoft/gulp-core-build-sass/node_modules/node-sass/package.json'

praveenbattula opened this issue · 10 comments

npm install, build or serve any command is failing to install node-sass. Tried all possibilities to clean, uninstall and install the package and with no luck.

Error: EINVAL: invalid argument, open '/usr/app/spfx/node_modules/@microsoft/gulp-core-build-sass/node_modules/node-sass/package.json'
at Object.fs.openSync (fs.js:646:18)
at Object.fs.readFileSync (fs.js:551:33)
at Object.Module._extensions..json (module.js:670:20)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object. (/usr/app/spfx/node_modules/@microsoft/gulp-core-build-sass/node_modules/node-sass/lib/extensions.js:7:9)
at Module._compile (module.js:653:30)

Which version of the image do you see this issue in? Which OS do you have on your host?

Thanks for the quick response as usual. I am using Windows 10 and the latest docker 1.7.1.

-Praveen.

Thanks for the info and the version of Docker. Which image are you using?

I am using the latest one. I ran the below command and it is

docker run -it --rm --name spfx-helloworld -v ${PWD}:/usr/app/spfx -p 5432:5432 -p 4321:4321 -p 35729:35729 waldekm/spfx

The above command is for macOS. I assume you're using its Windows equivalent. Thanks anyway for the info. I'll have a look if I can repro the issue.

OK, Here is what the instructions I followed. The command I have taken from below link for Windows OS:

https://github.com/waldekmastykarz/docker-spfx

Just to give more details on actual errors I get. Here is the log I see. Hope I hear some ideas. I am stuck as I am out of ideas what else can go wrong here.... Thanks for checking.

linux-x64-node-8 exists; testing
Binary is fine; exiting

node-sass@4.9.3 install /usr/app/spfx/node_modules/node-sass
node scripts/install.js

fs.js:646
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^

Error: EINVAL: invalid argument, open '/usr/app/spfx/node_modules/node-sass/package.json'
at Object.fs.openSync (fs.js:646:18)
at Object.fs.readFileSync (fs.js:551:33)
at Object.Module._extensions..json (module.js:670:20)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object. (/usr/app/spfx/node_modules/node-sass/lib/extensions.js:7:9)
at Module._compile (module.js:653:30)
npm WARN rollback Rolling back isarray@1.0.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/are-we-there-yet/node_modules/isarray'
npm WARN rollback Rolling back is-fullwidth-code-point@1.0.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/gauge/node_modules/is-fullwidth-code-point'
npm WARN rollback Rolling back is-fullwidth-code-point@1.0.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/sass-graph/node_modules/is-fullwidth-code-point'
npm WARN rollback Rolling back string-width@1.0.2 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/gauge/node_modules/string-width'
npm WARN rollback Rolling back which-module@1.0.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/sass-graph/node_modules/which-module'
npm WARN rollback Rolling back camelcase@3.0.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/sass-graph/node_modules/camelcase'
npm WARN rollback Rolling back isarray@1.0.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/stdout-stream/node_modules/isarray'
npm WARN rollback Rolling back os-locale@1.4.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/sass-graph/node_modules/os-locale'
npm WARN rollback Rolling back lru-cache@4.1.5 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/node-sass/node_modules/lru-cache'
npm WARN rollback Rolling back cliui@3.2.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/sass-graph/node_modules/cliui'
npm WARN rollback Rolling back string-width@1.0.2 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/sass-graph/node_modules/string-width'
npm WARN rollback Rolling back punycode@1.4.1 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/node-sass/node_modules/punycode'
npm WARN rollback Rolling back aproba@1.2.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/aproba'
npm WARN rollback Rolling back console-control-strings@1.1.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/console-control-strings'
npm WARN rollback Rolling back has-unicode@2.0.1 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/has-unicode'
npm WARN rollback Rolling back oauth-sign@0.8.2 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/node-sass/node_modules/oauth-sign'
npm WARN rollback Rolling back lodash.clonedeep@4.5.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/lodash.clonedeep'
npm WARN rollback Rolling back lodash.mergewith@4.6.1 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/lodash.mergewith'
npm WARN rollback Rolling back block-stream@0.0.9 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/block-stream'
npm WARN rollback Rolling back npmlog@4.1.2 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/npmlog'
npm WARN rollback Rolling back wide-align@1.1.3 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/wide-align'
npm WARN rollback Rolling back true-case-path@1.0.3 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/true-case-path'
npm WARN rollback Rolling back globule@1.2.1 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/node-sass/node_modules/globule'
npm WARN rollback Rolling back delegates@1.0.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/delegates'
npm WARN rollback Rolling back har-validator@5.0.3 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/node-sass/node_modules/har-validator'
npm WARN rollback Rolling back async-foreach@0.1.3 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/async-foreach'
npm WARN rollback Rolling back string_decoder@1.1.1 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/stdout-stream/node_modules/string_decoder'
npm WARN rollback Rolling back tough-cookie@2.3.4 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/node-sass/node_modules/tough-cookie'
npm WARN rollback Rolling back request@2.87.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/node-sass/node_modules/request'
npm WARN rollback Rolling back cross-spawn@3.0.1 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/node-sass/node_modules/cross-spawn'
npm WARN rollback Rolling back lodash@4.17.11 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/sass-graph/node_modules/lodash'
npm WARN rollback Rolling back in-publish@2.0.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/in-publish'
npm WARN rollback Rolling back gaze@1.1.3 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/node-sass/node_modules/gaze'
npm WARN rollback Rolling back yargs@7.1.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/sass-graph/node_modules/yargs'
npm WARN rollback Rolling back nan@2.12.1 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/nan'
npm WARN rollback Rolling back yargs-parser@5.0.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/sass-graph/node_modules/yargs-parser'
npm WARN rollback Rolling back string_decoder@1.1.1 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/are-we-there-yet/node_modules/string_decoder'
npm WARN rollback Rolling back fstream@1.0.11 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/fstream'
npm WARN rollback Rolling back lodash@4.17.11 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/node-sass/node_modules/lodash'
npm WARN rollback Rolling back tar@2.2.1 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/tar'
npm WARN rollback Rolling back source-map@0.4.4 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/scss-tokenizer/node_modules/source-map'
npm WARN rollback Rolling back @microsoft/sp-build-web@1.7.1 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/@microsoft/sp-build-web'
npm WARN rollback Rolling back readable-stream@2.3.6 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/stdout-stream/node_modules/readable-stream'
npm WARN rollback Rolling back readable-stream@2.3.6 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/are-we-there-yet/node_modules/readable-stream'
npm WARN rollback Rolling back node-gyp@3.8.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/node-gyp'
npm WARN rollback Rolling back node-sass@4.9.3 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/node-sass/node_modules/cross-spawn'
npm WARN rollback Rolling back sass-graph@2.2.4 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/sass-graph/node_modules/camelcase'
npm WARN rollback Rolling back @microsoft/gulp-core-build-sass@4.5.8 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/@microsoft/gulp-core-build-sass/node_modules/glob'
npm WARN rollback Rolling back are-we-there-yet@1.1.5 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/are-we-there-yet/node_modules/isarray'
npm WARN rollback Rolling back stdout-stream@1.4.1 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/stdout-stream/node_modules/isarray'
npm WARN rollback Rolling back gauge@2.7.4 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/gauge/node_modules/is-fullwidth-code-point'
npm WARN rollback Rolling back scss-tokenizer@0.2.3 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/usr/app/spfx/node_modules/scss-tokenizer/node_modules/source-map'
npm WARN ajv-keywords@3.2.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.9.3 install: node scripts/install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.9.3 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! /home/spfx/.npm/_logs/2019-01-06T19_23_49_053Z-debug.log

I can confirm that this error occures for 1.7.1 on Windows 10 Pro v1809 / Docker for Windows 18.09.0 / Docker Toolbox and VirtualBox. Mounting a separate volume for node_modules like it is suggested on a couple of sites won't fix the issue. npm rebuild node-sass also does not work because node-sass is stoping the postinstall process.

image

So this container is actually not useable on Docker for Windows.

I can repro the issue. Let me see if I can find anything more about it

This is the same issue as mentioned in #19. Closing this one so that we can track it in one place