Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
188
rated 0 times [  189] [ 1]  / answers: 1 / hits: 5503  / 5 Years ago, fri, september 27, 2019, 12:00:00

In My Gulpfile.js faulty part:



gulp.task('webpack', gulp.series(async () => {
const option = yargs.argv.release ? -p : -d;
execSync(`node_modules/webpack-cli/bin/cli.js ${option}`, {
stdio: [null, process.stdout, process.stderr]
});
}));


My package.json:



{
scripts: {
postinstall: npm run package-dev,
package-dev: node ./node_modules/gulp/bin/gulp.js,
package-release: node ./node_modules/gulp/bin/gulp.js --release
},
Dependencies: {
@types/applicationinsights-js: ^1.0.5,
@types/jquery: ^2.0.41,
@types/knockout: ^3.4.40,
@types/react: ^16.0.40,
@types/react-dom: ^16.9.1,
@types/requirejs: ^2.1.28,
del: ^3.0.0,
gulp: ^4.0.2,
gulp-inline-source: ^4.0.0,
gulp-sass: ^4.0.2,
gulp-tslint: ^8.1.1,
office-ui-fabric-react: ^4.5.0,
promise-polyfill: ^8.1.0,
requirejs: ^2.3.2,
ts-loader: ^4.1.0,
tslint: ^5.4.3,
typescript: ^3.1.6,
vss-web-extension-sdk: ^5.141.0,
webpack: ^4.26.1,
webpack-cli: ^3.1.2
},
name: task-group,
private: true,
version: 0.7.0,
dependencies: {
@uifabric/utilities: ^7.2.0,
react: ^16.9.0
},
main: gulpfile.js,
keywords: [],
author: ,
license: ISC,
description:
}


I running npm install and get the following error.



In Terminal Screen:




gulp.task('webpack', gulp.series(async () => {
^
SyntaxError: Unexpected token (
at Object.exports.runInThisContext (vm.js:76:16)
at Module._compile (module.js:542:28)
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 execute (C:UsersEceDocumentsProjectsLinks-Groupnode_modulesgulpnode_modulesgulp-clilibversioned^4.0.0index
.js:36:18)
at Liftoff.handleArguments (C:UsersEceDocumentsProjectsLinks-Groupnode_modulesgulpnode_modulesgulp-cliindex.js:2
01:24)



More From » node.js

 Answers
2

I have run the following commands respectively solved the problem.


npm rm -rf node_modules

npm install

[#6102] Wednesday, September 25, 2019, 5 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
josuea

Total Points: 609
Total Questions: 121
Total Answers: 104

Location: South Georgia
Member since Fri, Nov 13, 2020
4 Years ago
josuea questions
;