我已经下载了最新的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 build
后npm 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
}
})
还有几个笔记:
答案 0 :(得分:0)
Path must be a string.
这是Node 6的一个问题。
降级到节点4和npm 2,然后npm install
和gulp build
将有效。