Error occured when using now-cli develop in the terminal

Daniel Xiong
Giga Contributor

When I prepare the environment of the new UI framework in orlando, at the step of now-cli develop, it always shows error:

Error: Cannot find module '@servicenow/cli-component-archetype/package.json'

I've installed the package in the project folder and I can find the package.json file in the node_modules:find_real_file.pngfind_real_file.png

Any help?

1 ACCEPTED SOLUTION

Dear Dirk,

I solved this problem by the following steps:

npm install -g node-gyp

npm install --global --production windows-build-tools

npm cache clean -f

npm install

npm install node-sass (manully, maybe need npm rebuild node-sass if it doesn't work)

 

Now, it works fine.

 

Thank your, Dirk!

BR

Daniel

View solution in original post

16 REPLIES 16

DirkRedeker
Mega Sage

Can you show a screenshot from where you executed the CLI command?

BR

Dirk

Yes:

find_real_file.png

Did you use the latest version of the CLI? It may be updated recently?

Are you starting the CLI from the root folder of your component?

So, is the "hello-world" folder the root for your component?

Let me know, if you changed some of the "pre-built" files manually.

BR

Dirk

The missing thing seems to be a NPM module, which I find in my Project folder under

> \projectfolder\node_modules\@servicenow\cli-component-archetype\

In this folder, I have a "package.json" file. This seems to be missing in your project.

Can you please cross-check, if this file also exists in your project folder?

Please let me know about it.

BR

DIrk