一个用gulp启动的项目,mac电脑不报错,windows报这个错,有人知道怎么改吗?

FE_前端女孩
  • 8

下面图里面的那个warning,mac也有但是可以正常启动;但是windows电脑不仅有warning,主要是报错了,由于报错无法启动,求指点。。。

D:\project\fe-emishu-h5>gulp
[17:30:27] Using gulpfile D:\project\fe-emishu-h5\gulpfile.js
[17:30:27] Starting 'default'...
[17:30:27] Starting 'build:development'...
[17:30:27] Starting 'clean'...
[17:30:27] Finished 'clean' after 12 ms
[17:30:27] Starting 'copy'...
[17:30:27] Finished 'copy' after 19 μs
[17:30:27] Starting 'html'...
[17:30:27] Starting 'css'...
[17:30:27] Starting 'migrate'...
[17:30:28] Finished 'css' after 58 ms
[17:30:28] Finished 'migrate' after 67 ms
[17:30:28] Finished 'html' after 171 ms
[17:30:28] Starting 'webpack:development'...
(node:26384) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https://github.com/webpack/loader-utils/issues/56
parseQuery() will be replaced with getOptions() in the next major version of loader-utils.
[17:30:29] gulp-notify: [Error running Gulp] ModuleBuildError:
Module build failed:
D:\project\fe-emishu-h5\node_modules\babel-preset-es2015:1
(function (exports, require, module, __filename, __dirname) { .npminstall/babel-preset-es2015/6.24.1/babel-preset-es2015
                                                              ^

SyntaxError:
Unexpected token .
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:549:28)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at D:\project\fe-emishu-h5\node_modules\babel-core\lib\transformation\file\options\option-manager.js:296:17[17:30:29] Finished 'webpack:development' after 1.43 s
[17:30:29] Starting 'watch'...
[17:30:29] Finished 'watch' after 16 ms
[17:30:29] Finished 'build:development' after 1.8 s
[17:30:29] Starting 'server'...
[17:30:30] production server started on http://localhost:8019/
[17:30:31] Finished 'server' after 1.31 s
[17:30:31] Finished 'default' after 3.17 s
回复
阅读 1.4k
2 个回答

这个问题已经解决了,window上启动可能会报错(我当时node的版本是10.x),然后查了些资料 https://blog.csdn.net/wulala_...,将node版本降到6.x,
重新npm install 问题解决

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
宣传栏