Php &引用;新产品管理运行开发“;不在Windows上工作

Php &引用;新产品管理运行开发“;不在Windows上工作,php,node.js,laravel,npm,Php,Node.js,Laravel,Npm,Laravel版本:5.4.21 PHP版本:7.1.1 节点v4.4.5 npm v4.5.0 npm命令在windows(本例中为windows 7)上完全中断,每当我运行npm run dev时,我都会收到以下错误: > @ dev E:\xampp\htdocs\laravelblog > npm run development > @ development E:\xampp\htdocs\laravelblog > cross-env NODE_ENV=d

Laravel版本:5.4.21

PHP版本:7.1.1

节点v4.4.5

npm v4.5.0

npm命令在windows(本例中为windows 7)上完全中断,每当我运行npm run dev时,我都会收到以下错误:

> @ dev E:\xampp\htdocs\laravelblog
> npm run development


> @ development E:\xampp\htdocs\laravelblog
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

E:\xampp\htdocs\laravelblog\node_modules\laravel-mix\setup\webpack.config.js:1
(function (exports, require, module, __filename, __dirname) { let path = require('path');
                                                              ^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at requireConfig (E:\xampp\htdocs\laravelblog\node_modules\webpack\bin\convert-argv.js:96:18)
    at E:\xampp\htdocs\laravelblog\node_modules\webpack\bin\convert-argv.js:109:17
    at Array.forEach (native)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ development script 'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls
npm ERR! There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\winuser-pc\AppData\Roaming\npm-cache\_logs\2017-04-29T18_27_27_864Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ dev script 'npm run development'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run development
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls
npm ERR! There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\winuser-pc\AppData\Roaming\npm-cache\_logs\2017-04-29T18_27_27_938Z-debug.log
我尝试了默认的
package.json

{
  "private": true,
  "scripts": {
    "dev": "npm run development",
    "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch": "cross-env 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": "cross-env 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": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
  },
  "devDependencies": {
    "axios": "^0.15.3",
    "bootstrap-sass": "^3.3.7",
    "cross-env": "^3.2.3",
    "jquery": "^3.1.1",
    "laravel-mix": "0.*",
    "lodash": "^4.17.4",
    "vue": "^2.1.10"
  }
}
我还尝试了互联网上的其他帮助,比如这个

"scripts": {
    "dev": "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.config.js",
    "watch": "node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "hot": "node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
    "production": "node node_modules/cross-env/bin/cross-env.js NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
  },

告诉我这里怎么了。为什么它不起作用

每个人-如果你没有找到“cross env”,请npm安装cross env-D,然后确保你在package.json中更新你的npm脚本以引用cross env,而不是cross env的完整节点模块路径。

每个人-如果你没有找到“cross env”,请npm安装cross env-D,然后确保更新package.json中的npm脚本以引用cross env,而不是cross env的完整节点路径。

我面临同样的问题并克服了它 并忽略节点版本管理器
NVM

npm i-g纱线


纱线运行开发

我面临同样的问题并克服了它 并忽略节点版本管理器
NVM

npm i-g纱线


warn run dev

使用
尝试节点--使用\u strict
标记或安装最新的节点6.x(如果可能),如果没有,请使用上面建议的严格模式,也可以relevant@priyesh-库马尔:我是一个新发展的人。您能告诉我如何在package.json文件中使用这个
--use_strict
flagswrite
“dev”:“node--use_strict…”
”。它将删除上述错误,但可能会引入新错误,因为它使用strict标志运行所有代码。@priyesh kumar我尝试过这个。但它并没有奏效<代码>“dev”:“node--use_strict cross env node_env=development node_modules/webpack/bin/webpack.js--progress--hide modules--config=node_modules/laravel mix/setup/webpack.config.js”,用
尝试node--use_strict
标记或安装最新的node 6.x(如果可能),如果没有,使用上面建议的严格模式,也是relevant@priyesh-库马尔:我是一个新发展的人。您能告诉我如何在package.json文件中使用这个
--use_strict
flagswrite
“dev”:“node--use_strict…”
”。它将删除上述错误,但可能会引入新错误,因为它使用strict标志运行所有代码。@priyesh kumar我尝试过这个。但它并没有奏效<代码>“dev”:“node--use_cross env node_env=development node_modules/webpack/bin/webpack.js--progress--hide modules--config=node_modules/laravel mix/setup/webpack.config.js”,