microsoft / BotFramework-WebChat

A highly-customizable web-based client for Azure Bot Services.
https://www.botframework.com/
MIT License
1.56k stars 1.51k forks source link

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

Closed mk12345dfbfgn6 closed 7 years ago

mk12345dfbfgn6 commented 7 years ago

this is the snippet of errors npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! botframework-webchat@0.10.6 build: tsc && npm run build-css && webpack --progress npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the botframework-webchat@0.10.6 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

pvanaarde commented 7 years ago

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

danmarshall commented 7 years ago

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 ?

pvanaarde commented 7 years ago

@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....

danmarshall commented 7 years ago

@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

eanders-ms commented 7 years ago

@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?

pvanaarde commented 7 years ago

@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! botframework-webchat@0.10.6 build-css: node-sass ./src/scss/ -o . && rm -rf ./includes/ npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the botframework-webchat@0.10.6 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 commented 7 years ago

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

pvanaarde commented 7 years ago

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",

danmarshall commented 7 years ago

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

pvanaarde commented 7 years ago

@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.

danmarshall commented 7 years ago

I see. Would you mind sending a PR?

pvanaarde commented 7 years ago

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

danmarshall commented 7 years ago

@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 :)

pvanaarde commented 7 years ago

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

dirugadr commented 7 years ago

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! botframework-webchat@0.10.6 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 botframework-webchat@0.10.6 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

photodesignch commented 7 years ago

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/react@15.0.21 (downgrade your react to 15.0.21)
  2. npm install @types/react-redux@4.4.38 (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!

dirugadr commented 7 years ago

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!

photodesignch commented 7 years ago

@dirugadr Sorry! have you tried npm install @types/react-redux@4.4.38? Of course, the typescirpt should be npm install -g typescript@1.5.3

nicksav commented 7 years ago

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

nicksav commented 7 years ago

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

nwhitmont commented 7 years ago

TypeScript version issue breaking the build has been updated today and is in NPM release v0.10.8