aspnetcore-angular-universal icon indicating copy to clipboard operation
aspnetcore-angular-universal copied to clipboard

Compile error.

Open punkouter2021 opened this issue 6 years ago • 8 comments

Severity Code Description Project File Line Suppression State Error Missing binding C:\Users\MHerb\Downloads\aspnetcore-angular2-universal\node_modules\node-sass\vendor\win32-x64-59\binding.node Asp2017 C:\Users\MHerb\Downloads\aspnetcore-angular2-universal\Module build failed 1 Error Missing binding C:\Users\MHerb\Downloads\aspnetcore-angular2-universal\node_modules\node-sass\vendor\win32-x64-59\binding.node Asp2017 C:\Users\MHerb\Downloads\aspnetcore-angular2-universal\Module build failed 1 Error MSB3073 The command "node node_modules/webpack/bin/webpack.js" exited with code 2. Asp2017 C:\Users\MHerb\Downloads\aspnetcore-angular2-universal\Asp2017.csproj 41

punkouter2021 avatar Apr 09 '18 20:04 punkouter2021

Try running npm rebuild node-sass, I believe it's something to do with it being setup with a different version of Node than you're currently using.

MarkPieszak avatar Apr 09 '18 21:04 MarkPieszak

nope. Would it maybe work if I used a particular version of npm?

PS C:\Users\MHerb\Downloads\aspnetcore-angular2-universal-master\aspnetcore-angular2-universal-master> npm rebuild node- sass

[email protected] install C:\Users\MHerb\Downloads\aspnetcore-angular2-universal-master\aspnetcore-angular2-universal-master\node_modules\node-sass node scripts/install.js

node-sass build Binary found at C:\Users\MHerb\Downloads\aspnetcore-angular2-universal-master\aspnetcore-angular2-universal-master\node_modules\node-sass\vendor\win32-x64-59\binding.node

[email protected] postinstall C:\Users\MHerb\Downloads\aspnetcore-angular2-universal-master\aspnetcore-angular2-universal-master\node_modules\node-sass node scripts/build.js

Binary found at C:\Users\MHerb\Downloads\aspnetcore-angular2-universal-master\aspnetcore-angular2-universal-master\node_modules\node-sass\vendor\win32-x64-59\binding.node Testing binary Binary is fine [email protected] C:\Users\MHerb\Downloads\aspnetcore-angular2-universal-master\aspnetcore-angular2-universal-master\node_modules\node-sass

then tried

PS C:\Users\MHerb\Downloads\aspnetcore-angular2-universal-master\aspnetcore-angular2-universal-master> npm rebuild node- sass --force npm WARN using --force I sure hope you know what you are doing.

[email protected] install C:\Users\MHerb\Downloads\aspnetcore-angular2-universal-master\aspnetcore-angular2-universal-master\node_modules\node-sass node scripts/install.js

node-sass build Binary found at C:\Users\MHerb\Downloads\aspnetcore-angular2-universal-master\aspnetcore-angular2-universal-master\node_modules\node-sass\vendor\win32-x64-59\binding.node

[email protected] postinstall C:\Users\MHerb\Downloads\aspnetcore-angular2-universal-master\aspnetcore-angular2-universal-master\node_modules\node-sass node scripts/build.js

Building: C:\Program Files\nodejs\node.exe C:\Users\MHerb\Downloads\aspnetcore-angular2-universal-master\aspnetcore-angular2-universal-master\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library= gyp info it worked if it ends with ok gyp verb cli [ 'C:\Program Files\nodejs\node.exe', gyp verb cli 'C:\Users\MHerb\Downloads\aspnetcore-angular2-universal-master\aspnetcore-angular2-universal-master\node_modules\node-gyp\bin\node-gyp.js', gyp verb cli 'rebuild', gyp verb cli '--verbose', gyp verb cli '--libsass_ext=', gyp verb cli '--libsass_cflags=', gyp verb cli '--libsass_ldflags=', gyp verb cli '--libsass_library=' ] gyp info using [email protected] gyp info using [email protected] | win32 | x64 gyp verb command rebuild [] gyp verb command clean [] gyp verb clean removing "build" directory gyp verb command configure [] gyp verb check python checking for Python executable "python2" in the PATH gyp verb which failed Error: not found: python2

punkouter2021 avatar Apr 10 '18 18:04 punkouter2021

try deleting the contents of node_modules, then doing an npm install, then doing a npm rebuild node- sass --force

peterdobson avatar Apr 11 '18 05:04 peterdobson

I ran into the same problem with node-sass. Notice the last 2 lines in the log @punkouter , It's not finding Python2. In Visual Studio, go to "Tools/Get Tools and Features" and check the Python environment, then check to the right to include a Python2 (I just did x64). Not sure if it will work if you just use Python3 or not, but I did get npm rebuild node-sass --force to compile after installing Python2 tools.

Next: npm i -g npm-check-updates npm-check-updates -a --packageFile package.json npm install npm run build:dev

That seemed to help a bit, it builds now without errors. And, when debugging, it comes up in a browser for a second or two before spitting out some typescript errors, but maybe that gets us a little closer to a "first down":

ERROR in ./ClientApp/app/app.module.browser.ts Module not found: Error: Can't resolve 'preboot/browser' in 'C:\Dev\ProPotential\ProPotential - MarkPiezak\aspnetcore-angular2-universal\ClientApp\app' @ ./ClientApp/app/app.module.browser.ts 12:0-55 27:16-36 @ ./ClientApp/boot.browser.ts @ multi event-source-polyfill webpack-hot-middleware/client?path=dist%2F&dynamicPublicPath=true ./ClientApp/boot.browser.ts ERROR in [at-loader] ./ClientApp/app/app.module.ts:10:10 TS2305: Module '"C:/Dev/ProPotential/ProPotential - MarkPiezak/aspnetcore-angular2-universal/node_modules/ngx-bootstrap/index"' has no exported member 'Ng2BootstrapModule'. ERROR in [at-loader] ./ClientApp/app/app.module.browser.ts:10:38 TS2307: Cannot find module 'preboot/browser'. ERROR in [at-loader] ./ClientApp/app/app.module.server.ts:10:37 TS2307: Cannot find module 'preboot/server'.

Please post if this helps, or hurts, and if you come up with something better. I will too.

ProPotential avatar Apr 13 '18 22:04 ProPotential

I still can't get it to work. I tried all of the above.

System.AggregateException: 'One or more errors occurred. (Cannot find module './wwwroot/dist/vendor-manifest.json' Error: Cannot find module './wwwroot/dist/vendor-manifest.json' at Function.Module._resolveFilename (module.js:547:15) at Function.Module._load (module.js:474:25)

punkouter2021 avatar Apr 15 '18 23:04 punkouter2021

@punkouter I think I'm getting the same thing as you are now... For a while I got it up and working, but I think that doing a "rebuild" updated several npm packages and now I get an error similar to yours. My build gives an error on .csproj line 40, here's what's going on around there <Message Importance="high" Text="Performing first-run Webpack build..." /> <Exec Command="npm install" /> <Exec Command="node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js" /> <Exec Command="node node_modules/webpack/bin/webpack.js" />

if you run the "node" command after "npm install" from a command line, I get an error thrown from Chunk.js: Error: Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead

That prevents vendor-manifest.json from being created (I think). How to fix it? Don't know just yet.

ALSO: it looks like the ngx-bootstrap component has been upgraded, and Ng2BootstrapModule is no longer supported, so I just changed line 10 in app.modules.ts to import the AccordionModule only... see: https://github.com/valor-software/ngx-bootstrap/issues/1486

AND: I get an error trying to import BrowserPrebootModule from '/preboot/browser', and the same with '/preboot/server'. Doing an "npm i preboot --save" didn't fix it.

Sorry this doesn't fix the problem, but hopefully @MarkPieszak can take a closer look.

ProPotential avatar Apr 16 '18 22:04 ProPotential

Ill revisit this later if he fixes it.. I have some other templates to mess around with for now. QuickApp is a good one

punkouter2021 avatar Apr 17 '18 13:04 punkouter2021

I have same issue which is shown "NodeInvocationException: Cannot find module './wwwroot/dist/vendor-manifest.json'". Anyone solve this issue??????

BrissyKim avatar Oct 04 '18 01:10 BrissyKim