Skip to content

Symlink to env/bbin/npm fails if npm already exists #189

Closed

Description

@lsmithso

nodeenv 1.1.3 and 1.1.4 Symlink to env/bbin/npm fails if npm already exists. 1.1.2 works fine.

Reproduce by running nodeenv 2 or more times in the same venv.

nodeenv --python-virtualenv --prebuilt --node=7.10.0
nodeenv --python-virtualenv --prebuilt --node=7.10.0

nodeenv --python-virtualenv --prebuilt --node=7.10.0
 * Install prebuilt node (7.10.0) ....Traceback (most recent call last):
  File "/var/lib/jenkins/jobs/gryphon/workspace/env/bin/nodeenv", line 11, in <module>
    sys.exit(main())
  File "/var/lib/jenkins/jobs/gryphon/workspace/env/local/lib/python2.7/site-packages/nodeenv.py", line 1028, in main
    create_environment(env_dir, opt)
  File "/var/lib/jenkins/jobs/gryphon/workspace/env/local/lib/python2.7/site-packages/nodeenv.py", line 861, in create_environment
    install_node(env_dir, src_dir, opt)
  File "/var/lib/jenkins/jobs/gryphon/workspace/env/local/lib/python2.7/site-packages/nodeenv.py", line 681, in install_node
    copy_node_from_prebuilt(env_dir, src_dir, opt.node)
  File "/var/lib/jenkins/jobs/gryphon/workspace/env/local/lib/python2.7/site-packages/nodeenv.py", line 593, in copy_node_from_prebuilt
    copytree(src_folder, env_dir, True)
  File "/var/lib/jenkins/jobs/gryphon/workspace/env/local/lib/python2.7/site-packages/nodeenv.py", line 571, in copytree
    copytree(s, d, symlinks, ignore)
  File "/var/lib/jenkins/jobs/gryphon/workspace/env/local/lib/python2.7/site-packages/nodeenv.py", line 574, in copytree
    os.symlink(os.readlink(s), d)
OSError: [Errno 17] File exists

Activity

  1. ying-rao commented on Aug 8, 2017

    @ying-rao

    I got the same error with v1.2.0.

  2. lsmithso commented on Dec 6, 2017

    @lsmithso
    Author

    I tried this again with 1.2 .0 and its still a problem. Any chance of
    a fix?

  3. jaraco commented on Mar 20, 2018

    @jaraco

    Here's where the error occurs in the current master.

  4. added a commit that references this issue on Mar 21, 2018
  5. changed the title [-]nodeenb 1.1.3 and 1.1.4 Symlink to env/bbin/npm fails if npm already exists. 1.1.2 works fine.[/-] [+]Symlink to env/bbin/npm fails if npm already exists[/+] on Mar 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions