Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm install doesn't seem to work on Windows #307

Closed
MarkZ3 opened this issue Jul 18, 2017 · 15 comments
Closed

npm install doesn't seem to work on Windows #307

MarkZ3 opened this issue Jul 18, 2017 · 15 comments
Assignees
Labels
bug bugs found in the application
Milestone

Comments

@MarkZ3
Copy link
Contributor

MarkZ3 commented Jul 18, 2017

Using latest master
node v7.10.0
npm v4.2.0
Windows 8.1

...
> node scripts/generate.js && lerna bootstrap --hoist

core: yo theia:extension --force
cpp: yo theia:extension --force
editor: yo theia:extension --force
filesystem: yo theia:extension --force
java: yo theia:extension --force
languages: yo theia:extension --force
monaco: yo theia:extension --force
navigator: yo theia:extension --force
preferences: yo theia:extension --force
python: yo theia:extension --force
terminal: yo theia:extension --force
workspace: yo theia:extension --force
browser: yo theia:browser --force
electron: yo theia:electron --force
core: spawn yo ENOENT
cpp: spawn yo ENOENT
editor: spawn yo ENOENT
filesystem: spawn yo ENOENT
java: spawn yo ENOENT
languages: spawn yo ENOENT
monaco: spawn yo ENOENT
navigator: spawn yo ENOENT
preferences: spawn yo ENOENT
python: spawn yo ENOENT
terminal: spawn yo ENOENT
workspace: spawn yo ENOENT
browser: spawn yo ENOENT
electron: spawn yo ENOENT
lerna info version 2.0.0
lerna info versioning independent
lerna info Bootstrapping 0 packages
lerna info lifecycle preinstall
lerna info Installing external dependencies
lerna info hoist Finished installing in root
lerna info Symlinking packages and binaries
lerna info lifecycle postinstall
lerna info lifecycle prepublish
lerna success Bootstrapped 0 packages

> @theia/parent@0.0.0 clean C:\Users\Marc-Andre\git\theia
> lerna run clean --parallel

lerna info version 2.0.0
lerna info versioning independent
lerna WARN No packages found with the npm script 'clean'
lerna info run in 0 package(s): npm run clean

> @theia/parent@0.0.0 build C:\Users\Marc-Andre\git\theia
> lerna run build --stream

lerna info version 2.0.0
lerna info versioning independent
lerna WARN No packages found with the npm script 'build'

Then when I try to go to examples/electron:

$ npm run start
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_module                                       s\\npm\\bin\\npm-cli.js" "run" "start"
npm ERR! node v7.10.0
npm ERR! npm  v4.2.0

npm ERR! missing script: start
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Marc-Andre\AppData\Roaming\npm-cache\_logs\2017-07-18T15_02_36_217Z-d                                       ebug.log
@MarkZ3 MarkZ3 added the bug bugs found in the application label Jul 18, 2017
@akosyakov
Copy link
Member

akosyakov commented Jul 18, 2017

Could you go to packages/core and try yo theia:extension --force? You should do npm install -g yo before.

@MarkZ3
Copy link
Contributor Author

MarkZ3 commented Jul 18, 2017

Looks similar I think

~/git/theia/packages $ yo theia:extension --force
   create package.json
   create compile.tsconfig.json
~/git/theia/packages $ cd ..
~/git/theia $ npm install
...
> node scripts/generate.js && lerna bootstrap --hoist

core: yo theia:extension --force
cpp: yo theia:extension --force
editor: yo theia:extension --force
filesystem: yo theia:extension --force
java: yo theia:extension --force
languages: yo theia:extension --force
monaco: yo theia:extension --force
navigator: yo theia:extension --force
preferences: yo theia:extension --force
python: yo theia:extension --force
terminal: yo theia:extension --force
workspace: yo theia:extension --force
browser: yo theia:browser --force
electron: yo theia:electron --force
core: spawn yo ENOENT
cpp: spawn yo ENOENT
editor: spawn yo ENOENT
filesystem: spawn yo ENOENT
java: spawn yo ENOENT
languages: spawn yo ENOENT
monaco: spawn yo ENOENT
navigator: spawn yo ENOENT
preferences: spawn yo ENOENT
python: spawn yo ENOENT
terminal: spawn yo ENOENT
workspace: spawn yo ENOENT
browser: spawn yo ENOENT
electron: spawn yo ENOENT
lerna info version 2.0.0
lerna info versioning independent
lerna info Bootstrapping 0 packages
lerna info lifecycle preinstall
lerna info Installing external dependencies
lerna info hoist Finished installing in root
lerna info Symlinking packages and binaries
lerna info lifecycle postinstall
lerna info lifecycle prepublish
lerna success Bootstrapped 0 packages

> @theia/parent@0.0.0 clean C:\Users\Marc-Andre\git\theia
> lerna run clean --parallel

lerna info version 2.0.0
lerna info versioning independent
lerna WARN No packages found with the npm script 'clean'
lerna info run in 0 package(s): npm run clean

> @theia/parent@0.0.0 build C:\Users\Marc-Andre\git\theia
> lerna run build --stream

lerna info version 2.0.0
lerna info versioning independent
lerna WARN No packages found with the npm script 'build'

I checked that "yo" is on PATH and I can execute it in the same terminal. I wonder why it would do a ENOENT. Is the environment being overridden somehow along the way? Hmm

@akosyakov akosyakov self-assigned this Jul 19, 2017
akosyakov added a commit that referenced this issue Jul 19, 2017
Signed-off-by: Anton Kosiakov <anton.kosyakov@typefox.io>
@akosyakov
Copy link
Member

@MarkZ3 Could you try with #310?

@MarkZ3
Copy link
Contributor Author

MarkZ3 commented Jul 19, 2017

It looks similar I think.

> node scripts/generate.js && lerna bootstrap --hoist -- --no-optional

core: yo theia:extension --force
cpp: yo theia:extension --force
editor: yo theia:extension --force
filesystem: yo theia:extension --force
java: yo theia:extension --force
languages: yo theia:extension --force
monaco: yo theia:extension --force
navigator: yo theia:extension --force
preferences: yo theia:extension --force
python: yo theia:extension --force
terminal: yo theia:extension --force
workspace: yo theia:extension --force
browser: yo theia:browser --force
electron: yo theia:electron --force
core: spawn yo ENOENT
cpp: spawn yo ENOENT
editor: spawn yo ENOENT
filesystem: spawn yo ENOENT
java: spawn yo ENOENT
languages: spawn yo ENOENT
monaco: spawn yo ENOENT
navigator: spawn yo ENOENT
preferences: spawn yo ENOENT
python: spawn yo ENOENT
terminal: spawn yo ENOENT
workspace: spawn yo ENOENT
browser: spawn yo ENOENT
electron: spawn yo ENOENT
lerna info version 2.0.0
lerna info versioning independent
lerna info Bootstrapping 0 packages
lerna info lifecycle preinstall
lerna info Installing external dependencies
lerna info hoist Finished installing in root
lerna info Symlinking packages and binaries
lerna info lifecycle postinstall
lerna info lifecycle prepublish
lerna success Bootstrapped 0 packages

akosyakov added a commit that referenced this issue Jul 19, 2017
Signed-off-by: Anton Kosiakov <anton.kosyakov@typefox.io>
@akosyakov
Copy link
Member

@MarkZ3 Could you try again? :)

@MarkZ3
Copy link
Contributor Author

MarkZ3 commented Jul 19, 2017

It gets further now! Then it outputs this error:

> node scripts/generate.js && lerna boot

core: yo theia:extension --force
cpp: yo theia:extension --force
editor: yo theia:extension --force
filesystem: yo theia:extension --force
java: yo theia:extension --force
languages: yo theia:extension --force
monaco: yo theia:extension --force
navigator: yo theia:extension --force
preferences: yo theia:extension --force
python: yo theia:extension --force
terminal: yo theia:extension --force
workspace: yo theia:extension --force
browser: yo theia:browser --force
electron: yo theia:electron --force
filesystem:    create
filesystem:  package.json

cpp:    create
cpp:  package.json

java: C:\Users\Marc-Andre\git\theia\node_modules\insight\node_modules\configstore\index.js:69
                                throw err;
                                ^

Error: EPERM: operation not permitted, rename 'C:\Users\Marc-Andre\.config\configstore\insight-yo.json.3289871766' -> 'C
:\Users\Marc-Andre\.config\configstore\insight-yo.json'
    at Object.fs.renameSync (fs.js:776:18)
    at Function.writeFileSync [as sync] (C:\Users\Marc-Andre\git\theia\node_modules\insight\node_modules\write-file-atom
ic\index.js:124:8)
    at Configstore.set (C:\Users\Marc-Andre\git\theia\node_modules\insight\node_modules\configstore\index.js:62:21)
    at Configstore (C:\Users\Marc-Andre\git\theia\node_modules\insight\node_modules\configstore\index.js:27:11)
    at new Insight (C:\Users\Marc-Andre\git\theia\node_modules\insight\lib\index.js:38:34)
    at Object.<anonymous> (C:\Users\Marc-Andre\git\theia\node_modules\yo\lib\cli.js:43:17)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)

preferences: C:\Users\Marc-Andre\git\theia\node_modules\insight\node_modules\configstore\index.js:69
                                throw err;
                                ^

@akosyakov
Copy link
Member

@MarkZ3 it seems that yo tries to write to C:\Users\Marc-Andre\.config and don't have permissions, I guess permissions should be changed or maybe this folder is readonly

@MarkZ3
Copy link
Contributor Author

MarkZ3 commented Jul 19, 2017

@akosyakov No it's not read-only. Perhaps the file handle is still opened on insight-yo.json.3289871766 ?

@akosyakov
Copy link
Member

@MarkZ3 Could you try to add '--no-insight' as args in scripts/generate.js and run again:
const args = ['theia:' + target, '--force', '--no-insight']

@MarkZ3
Copy link
Contributor Author

MarkZ3 commented Jul 19, 2017

Same result. But looking at the yo/cli.js code, the insight object gets instantiated regardless of the --no-insight

const insight = new Insight({
  trackingCode: 'UA-31537568-1',
  pkg
});

What's more odd about the error is that the file does end up being renamed because I can see the insight-yo.json in folder. Or maybe it fails because it tries to rename to something that already exists??

> node scripts/generate.js && lerna bootstrap --hoist -- --no-optional

core: yo theia:extension --force --no-insight
cpp: yo theia:extension --force --no-insight
editor: yo theia:extension --force --no-insight
filesystem: yo theia:extension --force --no-insight
java: yo theia:extension --force --no-insight
languages: yo theia:extension --force --no-insight
monaco: yo theia:extension --force --no-insight
navigator: yo theia:extension --force --no-insight
preferences: yo theia:extension --force --no-insight
python: yo theia:extension --force --no-insight
terminal: yo theia:extension --force --no-insight
workspace: yo theia:extension --force --no-insight
browser: yo theia:browser --force --no-insight
electron: yo theia:electron --force --no-insight
java: C:\Users\Marc-Andre\git\theia\node_modules\insight\node_modules\configstore\index.js:69
                                throw err;
                                ^

Error: EPERM: operation not permitted, rename 'C:\Users\Marc-Andre\.config\configstore\insight-yo.json.2143822757' -> 'C
:\Users\Marc-Andre\.config\configstore\insight-yo.json'
    at Object.fs.renameSync (fs.js:776:18)
    at Function.writeFileSync [as sync] (C:\Users\Marc-Andre\git\theia\node_modules\insight\node_modules\write-file-atom
ic\index.js:124:8)
    at Configstore.set (C:\Users\Marc-Andre\git\theia\node_modules\insight\node_modules\configstore\index.js:62:21)
    at Configstore (C:\Users\Marc-Andre\git\theia\node_modules\insight\node_modules\configstore\index.js:27:11)
    at new Insight (C:\Users\Marc-Andre\git\theia\node_modules\insight\lib\index.js:38:34)
    at Object.<anonymous> (C:\Users\Marc-Andre\git\theia\node_modules\yo\lib\cli.js:43:17)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)

editor: C:\Users\Marc-Andre\git\theia\node_modules\insight\node_modules\configstore\index.js:69
                                throw err;

akosyakov added a commit that referenced this issue Jul 20, 2017
Signed-off-by: Anton Kosiakov <anton.kosyakov@typefox.io>
akosyakov added a commit that referenced this issue Jul 20, 2017
Signed-off-by: Anton Kosiakov <anton.kosyakov@typefox.io>
@akosyakov
Copy link
Member

akosyakov commented Jul 20, 2017

Looks like we hit this issue with running yo in parallel for different folders on windows: yeoman/yo#459

And it seems to be fixed already, could you try to update npm to 4.6.1?

@MarkZ3
Copy link
Contributor Author

MarkZ3 commented Jul 20, 2017

Unfortunately, I get the same error with 4.6.1.

@akosyakov
Copy link
Member

@MarkZ3 please try with #320 it runs yo sequential on windows

lmcgupe pushed a commit to lmcgupe/theia that referenced this issue Jul 21, 2017
Signed-off-by: Anton Kosiakov <anton.kosyakov@typefox.io>
lmcgupe pushed a commit to lmcgupe/theia that referenced this issue Jul 21, 2017
Signed-off-by: Anton Kosiakov <anton.kosyakov@typefox.io>
@MarkZ3
Copy link
Contributor Author

MarkZ3 commented Jul 21, 2017

I tried again, now it gets much further! But it hangs forever at

lerna info version 2.0.0
lerna info versioning independent
lerna info Bootstrapping 15 packages
lerna info lifecycle preinstall
lerna info Installing external dependencies
lerna info hoist Installing hoisted dependencies into root
lerna info hoist Pruning hoisted dependencies
lerna info hoist Finished pruning hoisted dependencies

It looks like lerna/lerna#582
But I verified that it uses Lerna 2.0.0 so I'm not sure.

@MarkZ3
Copy link
Contributor Author

MarkZ3 commented Jul 21, 2017

I does finish the second time I execute "yarn". Odd! But the next step for Electron has an error.

$ yarn run rebuild:electron
yarn run v0.27.5
error Command "rebuild:electron" not found.

@akosyakov akosyakov assigned kittaakos and unassigned akosyakov Jul 27, 2017
MarkZ3 added a commit to MarkZ3/theia that referenced this issue Jul 29, 2017
Since the command doesn't exist, use "shx" to replace it.
shx is a wrapper around ShellJS which is "Portable Unix shell
commands for Node.js"

Signed-off-by: Marc-André Laperle <marc-andre.laperle@ericsson.com>
@MarkZ3 MarkZ3 closed this as completed in 5039c3d Jul 29, 2017
Nebiroth pushed a commit to Nebiroth/theia that referenced this issue Jul 31, 2017
Since the command doesn't exist, use "shx" to replace it.
shx is a wrapper around ShellJS which is "Portable Unix shell
commands for Node.js"

Signed-off-by: Marc-André Laperle <marc-andre.laperle@ericsson.com>
@svenefftinge svenefftinge added this to the Theia 1.0 BETA milestone Sep 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application
Projects
None yet
Development

No branches or pull requests

4 participants