BotFramework-WebChat icon indicating copy to clipboard operation
BotFramework-WebChat copied to clipboard

tsc && npm run build-css && webpack --progress failed while runing npm install

Open mk12345dfbfgn6 opened this issue 9 years ago • 21 comments

this is the snippet of errors npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! [email protected] build: tsc && npm run build-css && webpack --progress npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the [email protected] build script 'tsc && npm run build-css && webp --progress'. 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 botframework-webchat package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! tsc && npm run build-css && webpack --progress npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs botframework-webchat npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls botframework-webchat 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\hpadmin\AppData\Roaming\npm-cache_logs\2017-05-09T09_42_10_932Z-debug.log

mk12345dfbfgn6 avatar May 09 '17 09:05 mk12345dfbfgn6

I have the same problem. Any feedback on this yet?

pvanaarde avatar Jun 09 '17 01:06 pvanaarde

It may be related to a fix for the typescript 2.3 compiler. Can you delete typescript from your node)modules folder, and npm install again ?

danmarshall avatar Jun 09 '17 04:06 danmarshall

@danmarshall Thanks for the reply. Tried it, but doesn't work. The node_modules folder is just repopulated with the typescript folder during npm install. Apologies if I am missing something here... Still new in the node & npm world....

pvanaarde avatar Jun 09 '17 04:06 pvanaarde

@pvanaarde no worries, and sorry I missed a step: git pull Then, can you look at your package.json and see if it specifies typescript 2.2.2 Then, look at your node_modules/typescript/package.json and see if it is 2.2.2

danmarshall avatar Jun 09 '17 04:06 danmarshall

@pvanaarde depending on your platform, the tsc command may be resolving to a globally installed version of typescript. Could you try running this: ./node_modules/.bin/tsc && npm run build-css && webpack --progress?

eanders-ms avatar Jun 09 '17 04:06 eanders-ms

@danmarshall @eanders-MS I have noticed that my errors appear to be a little bit different to the original listed in this issue, so might be a different issue altogether. Full error as per below:

'rm' is not recognized as an internal or external command, operable program or batch file.

npm ERR! Windows_NT 10.0.14393 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "build-css" npm ERR! node v6.11.0 npm ERR! npm v3.10.10 npm ERR! code ELIFECYCLE npm ERR! [email protected] build-css: node-sass ./src/scss/ -o . && rm -rf ./includes/ npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] build-css script 'node-sass ./src/scss/ -o . && rm -rf ./includes/'. 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 botframework-webchat package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-sass ./src/scss/ -o . && rm -rf ./includes/ npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs botframework-webchat npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls botframework-webchat npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! c:\Users\piete\Downloads\BotFramework-WebChat-master\BotFramework-WebChat-master\node_modules.bin\npm-debug.log

pvanaarde avatar Jun 09 '17 09:06 pvanaarde

Seems like the 'rm' command is the issue on a Windows device. Was able to successfully run install on a Mac.

pvanaarde avatar Jun 09 '17 11:06 pvanaarde

Was able to resolve this by updating the package.json to use the 'rimraf' command instead of 'rm -rf'. The rimraf component is already included in the package.json as a dependency, so not sure why it's not being used in the file. Updated lines from the package.json as follows: "build-css": "node-sass ./src/scss/ -o . && rimraf ./includes/", "clean": "rimraf built",

pvanaarde avatar Jun 19 '17 02:06 pvanaarde

@pvanaarde which shell are you using? Most shells I use seem to resolve the UNIX style commands.

danmarshall avatar Jun 19 '17 18:06 danmarshall

@danmarshall I tried the default Command Prompt, the Developer Command Prompt triggered from within Visual Studio, as well as the NPM Task Runner extension for Visual Studio that is then run via the Task Runner Explorer window. All of these were tried on multiple Windows machines.

pvanaarde avatar Jun 19 '17 23:06 pvanaarde

I see. Would you mind sending a PR?

danmarshall avatar Jun 19 '17 23:06 danmarshall

A Pull Request for my version of this repo? Apologies if a stupid question, still new with Git, npm and front-end...

pvanaarde avatar Jun 19 '17 23:06 pvanaarde

@pvanaarde Oh I see. If you're feeling adventurous, and you'd like to be a code contributor to this project, you can join the fun here on GitHub. Since you already have the fix you describe above. The easiest way is to go to package.json and find the "edit" button. GitHub will guide you through from there :)

danmarshall avatar Jun 19 '17 23:06 danmarshall

@danmarshall Thanks! Done.... https://github.com/Microsoft/BotFramework-WebChat/pull/517

pvanaarde avatar Jun 19 '17 23:06 pvanaarde

Hi, I've downloadad the code (instead of clone it) and when I ran NPM install, I got this error message:

`> tsc && npm run build-css && webpack --progress --config webpack.production.config.js

node_modules/@types/react/index.d.ts(195,27): error TS1005: ',' expected. node_modules/@types/react/index.d.ts(195,29): error TS1005: '>' expected. node_modules/@types/react/index.d.ts(195,31): error TS1128: Declaration or statement expected. node_modules/@types/react/index.d.ts(195,41): error TS1109: Expression expected. node_modules/@types/react/index.d.ts(216,27): error TS1005: ',' expected. node_modules/@types/react/index.d.ts(216,29): error TS1005: '>' expected. node_modules/@types/react/index.d.ts(216,31): error TS1128: Declaration or statement expected. node_modules/@types/react/index.d.ts(216,41): error TS1109: Expression expected. node_modules/@types/react/index.d.ts(218,34): error TS1005: ',' expected. node_modules/@types/react/index.d.ts(218,36): error TS1005: '>' expected. node_modules/@types/react/index.d.ts(218,38): error TS1128: Declaration or statement expected. node_modules/@types/react/index.d.ts(218,48): error TS1109: Expression expected. node_modules/@types/react/index.d.ts(220,9): error TS1005: ',' expected. node_modules/@types/react/index.d.ts(221,9): error TS1005: ',' expected. node_modules/@types/react/index.d.ts(232,16): error TS1005: ',' expected. node_modules/@types/react/index.d.ts(232,18): error TS1005: '>' expected. node_modules/@types/react/index.d.ts(232,20): error TS1005: ';' expected. node_modules/@types/react/index.d.ts(232,22): error TS1109: Expression expected. node_modules/@types/react/index.d.ts(232,45): error TS1005: '(' expected. node_modules/@types/react/index.d.ts(233,36): error TS1005: ',' expected. node_modules/@types/react/index.d.ts(233,38): error TS1005: '>' expected. node_modules/@types/react/index.d.ts(233,40): error TS1109: Expression expected. node_modules/@types/react/index.d.ts(234,9): error TS1136: Property assignment expected. node_modules/@types/react/index.d.ts(234,15): error TS1005: ',' expected. node_modules/@types/react/index.d.ts(234,55): error TS1109: Expression expected. node_modules/@types/react/index.d.ts(234,61): error TS1005: ';' expected. node_modules/@types/react/index.d.ts(234,81): error TS1005: '(' expected. node_modules/@types/react/index.d.ts(234,87): error TS1005: ')' expected. node_modules/@types/react/index.d.ts(235,19): error TS1109: Expression expected. node_modules/@types/react/index.d.ts(235,37): error TS1005: '(' expected. node_modules/@types/react/index.d.ts(236,22): error TS1109: Expression expected. node_modules/@types/react/index.d.ts(236,42): error TS1005: '(' expected. node_modules/@types/react/index.d.ts(237,22): error TS1109: Expression expected. node_modules/@types/react/index.d.ts(237,34): error TS1005: '(' expected. node_modules/@types/react/index.d.ts(238,21): error TS1109: Expression expected. node_modules/@types/react/index.d.ts(241,32): error TS1005: ',' expected. node_modules/@types/react/index.d.ts(241,34): error TS1005: '>' expected. node_modules/@types/react/index.d.ts(241,36): error TS1109: Expression expected. node_modules/@types/react/index.d.ts(243,9): error TS1005: ',' expected. node_modules/@types/react/index.d.ts(243,37): error TS1005: '(' expected. node_modules/@types/react/index.d.ts(244,42): error TS1005: '(' expected. node_modules/@types/react/index.d.ts(245,47): error TS1005: '(' expected. node_modules/@types/react/index.d.ts(246,34): error TS1005: '(' expected. node_modules/@types/react/index.d.ts(247,29): error TS1005: ',' expected. node_modules/@types/react/index.d.ts(250,39): error TS1005: ',' expected. node_modules/@types/react/index.d.ts(250,41): error TS1005: '>' expected. node_modules/@types/react/index.d.ts(250,43): error TS1109: Expression expected. node_modules/@types/react/index.d.ts(250,45): error TS1109: Expression expected. node_modules/@types/react/index.d.ts(252,9): error TS1005: ',' expected. node_modules/@types/react/index.d.ts(2746,1): error TS1128: Declaration or statement expected. npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! [email protected] prepublish: tsc && npm run build-css && webpack --progress --config webpack.production.config.js npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the [email protected] prepublish script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.`

I've tried to update that module, but the error remains. Thanks

dirugadr avatar Jun 30 '17 17:06 dirugadr

Yesterday when we bumped into this issue, we realized the package.json versions aren't matching with the building version. Please at least try following:

  1. npm install @types/[email protected] (downgrade your react to 15.0.21)
  2. npm install @types/[email protected] (downgrade your react-redux to 4.4.38)

These exceptions we saw on adaptivecards branch, but they are identical errors from @dirugadr has posted.

Thanks @compulim found out the solution!

photodesignch avatar Jun 30 '17 17:06 photodesignch

Well, I could perform the first step, but second one failed, the error was that there was not such 4.4.38 version for react-redux. I tried to run the build again, but it is still failing. Thanks!

dirugadr avatar Jun 30 '17 20:06 dirugadr

@dirugadr Sorry! have you tried npm install @types/[email protected]? Of course, the typescirpt should be npm install -g [email protected]

photodesignch avatar Jun 30 '17 21:06 photodesignch

Can't build as well. The same issues as @dirugadr

nicksav avatar Jul 04 '17 00:07 nicksav

Ok. Got this working. Updated React to React v15.0 and also TypeScript to 2.3

nicksav avatar Jul 04 '17 00:07 nicksav