Hello-World-tutorial: yo blockstack error


#1

Hello,

I am trying to understand how authentication is working within blockstack and so I am trying to follow Hello-World tutorials and I got an error as below and I appreciate your support to solve:

yo blockstack
/usr/lib/node_modules/yo/node_modules/write-file-atomic/index.js:197
        throw err
        ^

    Error: EACCES: permission denied, open '/root/.config/insight-nodejs/insight-yo.json.412770396'
        at Error (native)
        at Object.fs.openSync (fs.js:642:18)
        at Function.writeFileSync [as sync] (/usr/lib/node_modules/yo/node_modules/write-file-atomic/index.js:180:17)
        at Conf.set store [as store] (/usr/lib/node_modules/yo/node_modules/conf/index.js:142:19)
        at Conf.set (/usr/lib/node_modules/yo/node_modules/conf/index.js:64:14)
        at Insight.set optOut [as optOut] (/usr/lib/node_modules/yo/node_modules/insight/lib/index.js:56:15)
        at Object.<anonymous> (/usr/lib/node_modules/yo/lib/cli.js:198:18)
        at Module._compile (module.js:577:32)
        at Object.Module._extensions..js (module.js:586:10)
        at Module.load (module.js:494:32)

#2

Hello,

I am not sure this is the case, but I think you may need to use β€œsudo” (or whatever the equivalent would be for your operating system) with your commands, if npm is not installed globally.

It is possible if you installed npm just for this project, it was installed locally.

Can you try

$ npm list -g

to see if the associated modules are installed globally or locally?

-g indicates a global install.

You may be able to troubleshoot further based on this knowledge.

let me know how far this gets you.


#3

I am using root user to avoid any permission obstacles as it is for testing .
I tried β€œnpm list -g” and the below is the head of the result:

/usr/lib
β”œβ”€β”¬ generator-blockstack@0.5.0
β”‚ β”œβ”€β”¬ chalk@1.1.3
β”‚ β”‚ β”œβ”€β”€ ansi-styles@2.2.1
β”‚ β”‚ β”œβ”€β”€ escape-string-regexp@1.0.5
β”‚ β”‚ β”œβ”€β”€ has-ansi@2.0.0
β”‚ β”‚ β”œβ”€β”€ strip-ansi@3.0.1
β”‚ β”‚ └── supports-color@2.0.0
β”‚ β”œβ”€β”¬ yeoman-generator@3.2.0
β”‚ β”‚ β”œβ”€β”€ async@2.6.1
β”‚ β”‚ β”œβ”€β”¬ chalk@2.4.1
β”‚ β”‚ β”‚ β”œβ”€β”¬ ansi-styles@3.2.1
β”‚ β”‚ β”‚ β”‚ └─┬ color-convert@1.9.3
β”‚ β”‚ β”‚ β”‚ └── color-name@1.1.3
β”‚ β”‚ β”‚ └─┬ supports-color@5.5.0
β”‚ β”‚ β”‚ └── has-flag@3.0.0
β”‚ β”‚ β”œβ”€β”¬ cli-table@0.3.1


#4

I think yo forbids launching as root user. Try not being su, running it without any su or sudo, then try sudo if needed.

If these things do not work, try first checking what version of npm you have, and upgrading if needed, then running:

chmod g+rwx /root /root/.config /root/.config/configstore
chown root:root /root/.config/ -R

with the cmd edited for where you have your config file.

This was a fix for a now upgraded version of yo.

Regardless, I don’t think it supports running this as su.

Let me know where this gets you.


#5

For who faced the same issue of permissions, It is solved by using normal user. The OS is Centos .
@ginxh I faced another issue if you can support. After Installation and run npm start I got the below error:
npm start

> hello-blockstack@0.0.0 start /home/blockstack/hello-world-tutorial
> npm run browserify && node server.js

> hello-blockstack@0.0.0 browserify /home/blockstack/hello-world-tutorial
> browserify requires.js -o public/bundle.js

server is listening on 5000
(node:7028) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Exited with code 3