npm在使用docker时安装接收类型错误

时间:2016-07-24 13:24:13

标签: node.js ubuntu docker npm

我已经下载了最新的ubuntu docker镜像,并在图像上安装了node,npm等。我正在尝试对我的项目进行npm install。我一直收到3个这样的错误。我只会在第一次出现时显示。

path.js:7
throw new TypeError('Path must be a string. Received ' + inspect(path));
^

TypeError: Path must be a string. Received { url: 'https://raw.github.com/imagemin/pngquant-bin/v0.3.5/vendor/linux/x64/pngquant',
name: 'pngquant',
os: 'linux',
arch: 'x64' }
at assertPath (path.js:7:11)
at Object.basename (path.js:1357:5)
at /MyProject/WebContent/node_modules/download/index.js:35:43
at each (/MyProject/WebContent/node_modules/download/node_modules/each-async/each-async.js:63:4)
at module.exports (/MyProject/WebContent/node_modules/download/index.js:33:5)
at /MyProject/WebContent/node_modules/bin-wrapper/index.js:108:20
at /MyProject/WebContent/node_modules/bin-wrapper/index.js:141:24
at /MyProject/WebContent/node_modules/bin-check/index.js:30:20
at /MyProject/WebContent/node_modules/executable/index.js:39:20
at FSReqWrap.oncomplete (fs.js:117:15)

因此,当我gulp buildnpm install gulp build失败时,我会去npm install。但是,git config --global url."https://".insteadOf git://“成功”即使我收到这些类型错误。

有一点值得注意,我确实将此配置添加到我的泊坞窗图片中:jQuery.extend( jQuery.fn.dataTableExt.oSort, { "reference-pre": function ( ref ) { ref = ref.replace(/\./g, '') //remove dots while (ref.length < 4) ref += '0' //add 0 until length 4 return parseInt(ref) //return as number } })

还有几个笔记:

  1. 这适用于我的本地计算机mac或windows。
  2. node -v v6.2.2 npm -v 3.9.5

1 个答案:

答案 0 :(得分:0)

Path must be a string.

这是Node 6的一个问题。

降级到节点4和npm 2,然后npm installgulp build将有效。