0

I am trying to build and deploy the code from https://github.com/Autodesk-Forge/forge-rcdb.nodejs on Windows10

On MacOS, I successfully build it in the development environment, and now I am trying to make it happen on Windows. I followed the same steps, on Windows, I used:

 $env:NODE_ENV = "developement"
 $env:HOT_RELOADING="true"
 npm start

But my Powershell shows:

> forge-rcdb@4.0.0 start D:\Documents\forge-rcdb.nodejs

> node bin/start.js

internal/modules/cjs/loader.js:583

    throw err;

    ^

Error: Cannot find module '../../config/developement.config.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (D:\Documents\forge-rcdb.nodejs\node_modules\c0nfig\index.js:10:14)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Object.require.extensions.(anonymous function) [as .js] (D:\Documents\forge-rcdb.nodejs\node_modules\babel-register\lib\node.js:152:7)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! forge-rcdb@4.0.0 start: `node bin/start.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the forge-rcdb@4.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\yangdihan\AppData\Roaming\npm-cache\_logs\2018-12-28T21_12_28_942Z-debug.log
PS D:\Documents\forge-rcdb.nodejs> npm install cairo
npm ERR! code E404
npm ERR! 404 Not Found: cairo@latest

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\yangdihan\AppData\Roaming\npm-cache\_logs\2018-12-28T21_20_30_522Z-debug.log

Might this be caused because Windows has backslash instead of slash for path?

DiHan Yang
  • 15
  • 3
  • 1
    Have you run `npm install` on Mac and then tried to use the same directory under Windows? If so, remove `node_modules` and run `npm install` again, there might be native modules in there which are build for Mac instead of Windows. – Lukas Knuth Dec 28 '18 at 21:42
  • also, it looks like "development" is mispelled. – 4m1r Dec 28 '18 at 22:19
  • Yes, I did run {npm install} on windows. There are several warns but no errors – DiHan Yang Dec 29 '18 at 00:22
  • Please check my instruction here, it might help: https://stackoverflow.com/a/50284712/7745569 – Eason Kang Dec 29 '18 at 03:50

2 Answers2

0

Looks like there's a typo(developement) for development and that caused the error:

Error: Cannot find module '../../config/developement.config.js'

Set your environment to a corresponding profile in the config folder, otherwise the c0nfig library won't be able to locate the configuration:

config -
       |--- development.config.js
       |--- production.config.js
Bryan Huang
  • 5,247
  • 2
  • 15
  • 20
0

I solved eventually. The solution is to install Python2.7, C++ compiler, c# compiler. Just use Visual Studio installer to install them is okay. Then very probably need to need to fix npm canvas/cairo, following this instruction: https://github.com/benjamind/delarre.docpad/blob/master/src/documents/posts/installing-node-canvas-for-windows.html.md

then everything works

DiHan Yang
  • 15
  • 3