【发布时间】:2018-06-22 15:52:42
【问题描述】:
Laravel 版本:5.4.1 PHP版本:5.6 节点 v8.9.3 npm v5.5.1 描述: npm 命令在 Windows(本例中为 Windows 7)上完全损坏,每当我运行 npm run dev 时,都会出现以下错误:
'node_modules' 未被识别为内部或外部命令, 可运行的程序或批处理文件。
我的 package.json
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"axios": "^0.16.2",
"bootstrap-sass": "^3.3.7",
"cross-env": "^5.0.1",
"jquery": "^3.1.1",
"laravel-mix": "^1.0",
"lodash": "^4.17.4",
"vue": "^2.1.10"
},
"dependencies": {
"laravel-echo": "^1.3.3",
"pusher-js": "^4.2.2"
}
}
并显示错误
> @ dev c:\wamp\www\web
> node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.co
nfig.js
path.js:7
throw new TypeError('Path must be a string. Received ' + inspect(path));
^
TypeError: Path must be a string. Received undefined
at assertPath (path.js:7:11)
at Object.parse (path.js:950:5)
at new File (c:\wamp\www\web\node_modules\laravel-mix\src\File.js:14:30)
at Object.module.exports.preprocess (c:\wamp\www\web\node_modules\laravel-mix\src\index.js:108:14)
at Object.module.exports.sass (c:\wamp\www\web\node_modules\laravel-mix\src\index.js:84:27)
at Object.<anonymous> (c:\wamp\www\web\webpack.mix.js:17:5)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Mix.initialize (c:\wamp\www\flores\node_modules\laravel-mix\src\Mix.js:38:9)
at Object.<anonymous> (c:\wamp\www\flores\node_modules\laravel-mix\setup\webpack.config.js:18:5)
at Module._compile (module.js:570:32)
我已经搜索或花费了更多时间,但没有成功,如果有人有想法请提前告诉我谢谢
【问题讨论】:
标签: node.js laravel npm push-notification npm-install