在docker上执行npm安装时出现问题

在docker上执行npm安装时出现问题,docker,npm,node-sass,Docker,Npm,Node Sass,与同事在同一个项目上工作时,在执行npm安装时,我遇到了以下问题,尽管我的同事中没有一个有相同的问题。我们都使用docker环境,linux容器 这就是错误: npm install npm WARN deprecated browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools. npm WARN deprecated browserslis

与同事在同一个项目上工作时,在执行npm安装时,我遇到了以下问题,尽管我的同事中没有一个有相同的问题。我们都使用docker环境,linux容器

这就是错误:

npm install
npm WARN deprecated browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated socks@1.1.10: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0

> node-sass@4.9.3 install /var/www/node_modules/node-sass
> node scripts/install.js

fs.js:113
    throw err;
    ^

Error: EINVAL: invalid argument, open '/var/www/node_modules/node-sass/package.json'
    at Object.openSync (fs.js:434:3)
    at Object.readFileSync (fs.js:339:35)
    at Object.Module._extensions..json (internal/modules/cjs/loader.js:706:20)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/var/www/node_modules/node-sass/lib/extensions.js:7:9)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
npm WARN rollback Rolling back is-fullwidth-code-point@1.0.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/gauge/node_modules/is-fullwidth-code-point'
npm WARN rollback Rolling back camelcase@3.0.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/sass-graph/node_modules/camelcase'
npm WARN rollback Rolling back string-width@1.0.2 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/gauge/node_modules/string-width'
npm WARN rollback Rolling back is-fullwidth-code-point@1.0.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/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 '/var/www/node_modules/sass-graph/node_modules/string-width'
npm WARN rollback Rolling back abbrev@1.1.1 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/abbrev'
npm WARN rollback Rolling back assert-plus@1.0.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/assert-plus'
npm WARN rollback Rolling back aws-sign2@0.7.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/aws-sign2'
npm WARN rollback Rolling back caseless@0.12.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/caseless'
npm WARN rollback Rolling back console-control-strings@1.1.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/console-control-strings'
npm WARN rollback Rolling back aws4@1.8.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/aws4'
npm WARN rollback Rolling back forever-agent@0.6.1 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/forever-agent'
npm WARN rollback Rolling back extend@3.0.2 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/extend'
npm WARN rollback Rolling back has-unicode@2.0.1 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/has-unicode'
npm WARN rollback Rolling back block-stream@0.0.9 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/block-stream'
npm WARN rollback Rolling back is-typedarray@1.0.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/is-typedarray'
npm WARN rollback Rolling back isstream@0.1.2 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/isstream'
npm WARN rollback Rolling back jsbn@0.1.1 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/jsbn'
npm WARN rollback Rolling back lodash.mergewith@4.6.1 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/lodash.mergewith'
npm WARN rollback Rolling back lodash.clonedeep@4.5.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/lodash.clonedeep'
npm WARN rollback Rolling back oauth-sign@0.8.2 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/oauth-sign'
npm WARN rollback Rolling back safer-buffer@2.1.2 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/safer-buffer'
npm WARN rollback Rolling back ansi-styles@2.2.1 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/node-sass/node_modules/ansi-styles'
npm WARN rollback Rolling back osenv@0.1.5 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/osenv'
npm WARN rollback Rolling back supports-color@2.0.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/node-sass/node_modules/supports-color'
npm WARN rollback Rolling back tunnel-agent@0.6.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/tunnel-agent'
npm WARN rollback Rolling back chalk@1.1.3 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/node-sass/node_modules/chalk'
npm WARN rollback Rolling back camelcase@3.0.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/yargs-parser/node_modules/camelcase'
npm WARN rollback Rolling back bcrypt-pbkdf@1.0.2 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/bcrypt-pbkdf'
npm WARN rollback Rolling back tweetnacl@0.14.5 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/tweetnacl'
npm WARN rollback Rolling back npmlog@4.1.2 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/npmlog'
npm WARN rollback Rolling back are-we-there-yet@1.1.5 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/are-we-there-yet'
npm WARN rollback Rolling back wide-align@1.1.3 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/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 '/var/www/node_modules/true-case-path'
npm WARN rollback Rolling back semver@5.3.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/node-gyp/node_modules/semver'
npm WARN rollback Rolling back asynckit@0.4.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/asynckit'
npm WARN rollback Rolling back async-foreach@0.1.3 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/async-foreach'
npm WARN rollback Rolling back dashdash@1.14.1 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/dashdash'
npm WARN rollback Rolling back delayed-stream@1.0.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/delayed-stream'
npm WARN rollback Rolling back extsprintf@1.3.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/extsprintf'
npm WARN rollback Rolling back delegates@1.0.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/delegates'
npm WARN rollback Rolling back cross-spawn@3.0.1 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/node-sass/node_modules/cross-spawn'
npm WARN rollback Rolling back combined-stream@1.0.6 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/combined-stream'
npm WARN rollback Rolling back getpass@0.1.7 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/getpass'
npm WARN rollback Rolling back har-validator@5.0.3 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/har-validator'
npm WARN rollback Rolling back json-stringify-safe@5.0.1 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/json-stringify-safe'
npm WARN rollback Rolling back in-publish@2.0.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/in-publish'
npm WARN rollback Rolling back har-schema@2.0.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/har-schema'
npm WARN rollback Rolling back form-data@2.3.2 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/form-data'
npm WARN rollback Rolling back nopt@3.0.6 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/nopt'
npm WARN rollback Rolling back nan@2.11.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/nan'
npm WARN rollback Rolling back verror@1.10.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/verror'
npm WARN rollback Rolling back tough-cookie@2.3.4 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/tough-cookie'
npm WARN rollback Rolling back jsprim@1.4.1 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/jsprim'
npm WARN rollback Rolling back ecc-jsbn@0.1.2 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/ecc-jsbn'
npm WARN rollback Rolling back qs@6.5.2 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/qs'
npm WARN rollback Rolling back request@2.87.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/request'
npm WARN rollback Rolling back gaze@1.1.3 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/gaze'
npm WARN rollback Rolling back http-signature@1.2.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/http-signature'
npm WARN rollback Rolling back globule@1.2.1 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/globule'
npm WARN rollback Rolling back tar@2.2.1 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/tar'
npm WARN rollback Rolling back fstream@1.0.11 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/fstream'
npm WARN rollback Rolling back yargs@7.1.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/sass-graph/node_modules/yargs'
npm WARN rollback Rolling back json-schema@0.2.3 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/json-schema'
npm WARN rollback Rolling back performance-now@2.1.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/performance-now'
npm WARN rollback Rolling back asn1@0.2.4 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/asn1'
npm WARN rollback Rolling back source-map@0.4.4 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/scss-tokenizer/node_modules/source-map'
npm WARN rollback Rolling back stdout-stream@1.4.1 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/stdout-stream'
npm WARN rollback Rolling back sshpk@1.14.2 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/sshpk'
npm WARN rollback Rolling back laravel-mix@2.1.14 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/laravel-mix'
npm WARN rollback Rolling back node-gyp@3.8.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/node-gyp/node_modules/semver'
npm WARN rollback Rolling back sass-graph@2.2.4 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/sass-graph/node_modules/is-fullwidth-code-point'
npm WARN rollback Rolling back gauge@2.7.4 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/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 '/var/www/node_modules/scss-tokenizer/node_modules/source-map'
npm WARN rollback Rolling back yargs-parser@5.0.0 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/yargs-parser/node_modules/camelcase'
npm WARN rollback Rolling back node-sass@4.9.3 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/var/www/node_modules/node-sass/node_modules/chalk'
npm WARN bootstrap@4.1.3 requires a peer of popper.js@^1.14.3 but none is installed. You must install peer dependencies yourself.
npm WARN img-loader@3.0.0 requires a peer of imagemin@^5.0.0 but none is installed. You must install peer dependencies yourself.
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!     /root/.npm/_logs/2018-08-30T10_12_31_719Z-debug.log
npm安装
npm警告已弃用browserslist@2.11.3:Browserslist 2在读取其他工具中使用的Browserslist>3.0配置时可能失败。
npm警告已弃用browserslist@1.7.7:Browserslist 2在读取其他工具中使用的Browserslist>3.0配置时可能失败。
npm警告已弃用socks@1.1.10:如果使用2.x分支,请至少升级到2.1.6,以避免套接字数据流的严重错误和2.1.0中引入的导入问题
>节点-sass@4.9.3安装/var/www/node_modules/node sass
>节点脚本/install.js
财政司司长:113
犯错误;
^
错误:EINVAL:无效参数,打开“/var/www/node_modules/node sass/package.json”
在Object.openSync(fs.js:434:3)
在Object.readFileSync(fs.js:339:35)
at Object.Module._extensions..json(internal/modules/cjs/loader.js:706:20)
在Module.load(内部/modules/cjs/loader.js:599:32)
在tryModuleLoad(内部/modules/cjs/loader.js:538:12)
at Function.Module._load(内部/modules/cjs/loader.js:530:3)
at Module.require(内部/modules/cjs/loader.js:637:17)
根据需要(内部/modules/cjs/helpers.js:20:18)
反对。(/var/www/node_modules/node sass/lib/extensions.js:7:9)
at模块编译(内部/modules/cjs/loader.js:689:30)
npm WARN rollback回滚是全宽代码-point@1.0.0失败(这可能是无害的):en诱惑:目录不为空,rmdir'/var/www/node_modules/gauge/node_modules/为全宽代码点'
npm警告回滚回滚camelcase@3.0.0失败(这可能是无害的):en诱惑:目录不为空,rmdir'/var/www/node_modules/sass graph/node_modules/camelcase'
npm警告回滚回滚字符串-width@1.0.2失败(这可能是无害的):en诱惑:目录不为空,rmdir'/var/www/node_modules/gauge/node_modules/string width'
npm WARN rollback回滚是全宽代码-point@1.0.0失败(这可能是无害的):en诱惑:目录不为空,rmdir'/var/www/node_modules/sass graph/node_modules/是全宽代码点'
npm警告回滚回滚字符串-width@1.0.2失败(这可能是无害的):en诱惑:目录不为空,rmdir'/var/www/node_modules/sass graph/node_modules/string width'
npm警告回滚回滚abbrev@1.1.1失败(这可能是无害的):en诱惑:目录不为空,rmdir'/var/www/node_modules/abbrev'
npm警告回滚回滚断言-plus@1.0.0失败(这可能是无害的):en诱惑:目录不为空,rmdir'/var/www/node_modules/assert plus'
npm警告回滚回滚aws-sign2@0.7.0失败(这可能是无害的):en诱惑:目录不为空,rmdir'/var/www/node_modules/aws-sign2'
npm警告回滚回滚caseless@0.12.0失败(这可能是无害的):en诱惑:目录不为空,rmdir'/var/www/node_modules/caseless'
npm警告回滚回滚控制台控制-strings@1.1.0失败(这可能是无害的):en诱惑:目录不为空,rmdir'/var/www/node_modules/console control strings'
npm警告回滚回滚aws4@1.8.0失败(这可能是无害的):en诱惑:目录不为空,rmdir'/var/www/node_modules/aws4'
npm警告回滚永久回滚-agent@0.6.1失败(这可能是无害的):en诱惑:目录不为空,rmdir'/var/www/node\u modules/forever agent'
npm警告回滚回滚extend@3.0.2失败(这可能是无害的):en诱惑:目录不为空,rmdir'/var/www/node\u modules/extend'
npm警告回滚回滚已完成-unicode@2.0.1失败(这可能是无害的):en诱惑:目录不为空,rmdir'/var/www/node_modules/has unicode'
npm警告回滚回滚块-stream@0.0.9失败(这可能是无害的):en诱惑:目录不为空,rmdir'/var/www/node_modules/block stream'
npm警告回滚正在回滚-typedarray@1.0.0失败(这可能是无害的):en诱惑:目录不为空,rmdir'/var/www/node_modules/is typedarray'
npm警告回滚回滚isstream@0.1.2失败(这可能是无害的):en诱惑:目录不为空,rmdir'/var/www/node\u modules/isstream'
npm警告回滚回滚jsbn@0.1.1失败(这可能是无害的):en诱惑:目录不为空,rmdir'/var/www/node_modules/jsbn'
npm警告回滚回滚lodash。mergewith@4.6.1失败(这可能是无害的):en诱惑:目录不为空,rmdir'/var/www/node_modules/lodash.mergewith'
npm警告回滚回滚lodash。clonedeep@4.5.0失败(这可能是无害的):en诱惑:目录不为空,rmdir'/var/www/node_modules/lodash.clonedeep'
npm警告回滚回滚oauth-sign@0.8.2失败(这可能是无害的):en诱惑:目录不为空,rmdir'/var/www/node_modules/oauth sign'
npm警告回滚回滚更安全-buffer@2.1.2失败(这可能是无害的):en诱惑:目录不为空,rmdir'/var/www/node\u modules/safe buffer'
npm警告回滚回滚ansi-styles@2.2.1失败(这可能是无害的):en诱惑:目录不为空,rmdir'/var/www/node_modules/node sass/node_modules/ansi styles'
npm警告回滚回滚osenv@0.1.5失败(这可能是无害的):en诱惑:目录不为空,rmdir'/var/www/node_modules/osenv'
npm警告回滚回滚支持-color@2.0.0失败(这可能是无害的):en诱惑:目录不为空,rmdir'/var/www/node_modules/node sass/node_modules/supports color'
npm警告回滚回滚隧道-agent@0.6.0失败(这可能是无害的):en诱惑:目录不为空,rmdir'/var/www/node_modules/tunnel agent'
npm警告回滚回滚chalk@1.1.3失败(这可能是无害的):en诱惑:目录不为空,rmdir'/var/www/node_modules/node sass/node_m
...
  volumes:
    - .:/var/www
    - node_modules:/var/www/node_modules