Ipywidgets: ValueError: "@jupyter-widgets/jupyterlab-manager" is not a valid npm package

Created on 23 Feb 2018  路  12Comments  路  Source: jupyter-widgets/ipywidgets

I am trying to run the following powershell command in Windows 10:

jupyter labextension install @jupyter-widgets/jupyterlab-manager

The ValueError in the subject-line is raised. Below are some relevant version numbers from my Anaconda installation:

  • python 3.6.4 64-bit
  • conda 4.3.34
  • notebook 5.4.0
  • ipywidgets 7.1.2
  • jupyter 1.0.0
  • jupyterlab 0.31.8
  • npm 1.4.12
  • nodejs 8.9.1

and here is the output after using the --debug option:

PS C:\Users\jeschwar> jupyter labextension install @jupyter-widgets/jupyterlab-manager --debug
> C:\Anaconda3_64bit\Scripts\npm.CMD pack @jupyter-widgets/jupyterlab-manager
npm ERR! addLocal Could not install jupyter-widgets/jupyterlab-manager
npm ERR! Error: ENOENT: no such file or directory, stat 'C:\Users\jeschwar\AppData\Local\Temp\tmpusxl33eq\jupyter-widgets\jupyterlab-manager'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Windows_NT 10.0.10586
npm ERR! command "C:\\Anaconda3_64bit\\node.exe" "C:\\Anaconda3_64bit\\Library\\lib\\node_modules\\npm\\bin\\npm-cli.js" "pack" "@jupyter-widgets/jupyterlab-manager"
npm ERR! cwd C:\Users\jeschwar\AppData\Local\Temp\tmpusxl33eq
npm ERR! node -v v8.9.1
npm ERR! npm -v 1.4.12
npm ERR! path C:\Users\jeschwar\AppData\Local\Temp\tmpusxl33eq\jupyter-widgets\jupyterlab-manager
npm ERR! syscall stat
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Users\jeschwar\AppData\Local\Temp\tmpusxl33eq\npm-debug.log
npm ERR! not ok code 0
Traceback (most recent call last):

  File "C:\Anaconda3_64bit\lib\site-packages\jupyterlab\labextensions.py", line 71, in start
    ans = self.run_task()

  File "C:\Anaconda3_64bit\lib\site-packages\jupyterlab\labextensions.py", line 100, in run_task
    for arg in self.extra_args

  File "C:\Anaconda3_64bit\lib\site-packages\jupyterlab\labextensions.py", line 100, in <listcomp>
    for arg in self.extra_args

  File "C:\Anaconda3_64bit\lib\site-packages\jupyterlab\commands.py", line 210, in install_extension
    return handler.install_extension(extension)

  File "C:\Anaconda3_64bit\lib\site-packages\jupyterlab\commands.py", line 347, in install_extension
    info = self._install_extension(extension, tempdir)

  File "C:\Anaconda3_64bit\lib\site-packages\jupyterlab\commands.py", line 1095, in _install_extension
    info = self._extract_package(extension, tempdir)

  File "C:\Anaconda3_64bit\lib\site-packages\jupyterlab\commands.py", line 1135, in _extract_package
    raise ValueError(msg % source)

ValueError: "@jupyter-widgets/jupyterlab-manager" is not a valid npm package


Errored, use --debug for full output:
ValueError: "@jupyter-widgets/jupyterlab-manager" is not a valid npm package

I realize the output says to create an issue in npm/npm but I thought I would start here because everything works fine when I tried this in Linux including the ipywidgets displaying correctly in JupyterLab.

Is this extension currently supported in Windows 10?

resolved-locked

Most helpful comment

It looks like the relevant line is:

npm ERR! Error: ENOENT: no such file or directory, stat 'C:\Users\jeschwar\AppData\Local\Temp\tmpusxl33eq\jupyter-widgets\jupyterlab-manager'

Does that directory exist? Huh - why does it not have the @? Perhaps in windows things need to be quoted? I think @ may be a comment character?

Can you try jupyter labextension install "@jupyter-widgets/jupyterlab-manager"?

All 12 comments

It looks like the relevant line is:

npm ERR! Error: ENOENT: no such file or directory, stat 'C:\Users\jeschwar\AppData\Local\Temp\tmpusxl33eq\jupyter-widgets\jupyterlab-manager'

Does that directory exist? Huh - why does it not have the @? Perhaps in windows things need to be quoted? I think @ may be a comment character?

Can you try jupyter labextension install "@jupyter-widgets/jupyterlab-manager"?

I think @ may be a comment character?

Probably not a comment character, but still maybe a special character for some reason? Can you try the quoted version?

Sure. I tried the following commands with no success:

jupyter labextension install "@jupyter-widgets/jupyterlab-manager"
jupyter labextension install "jupyter-widgets/jupyterlab-manager"
jupyter labextension install jupyter-widgets/jupyterlab-manager

I can see the strange tmp... directory created but then it is deleted after about 1 second.

I'm not sure whether using the npm installer directly is supposed to work but it gave the following output:

PS C:\Users\jeschwar> npm i @jupyter-widgets/jupyterlab-manager
npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\jeschwar\package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\jeschwar\package.json'
npm WARN jeschwar No description
npm WARN jeschwar No repository field.
npm WARN jeschwar No README data
npm WARN jeschwar No license field.

+ @jupyter-widgets/[email protected]
added 100 packages in 68.827s

however ipywidgets are not displayed in JupyterLab

The npm install command won't do what you want. I'll try to set up a windows setup to see if I can reproduce this error.

Does it work outside of powershell, in the normal windows cmd.exe?

npm 1.4.12

This seems awfully low (it was released in 2014). Could you try updating it?

Looks like the issue was with my npm installation.

When I was initially trying to get JupyterLab working it gave me the following exception from jupyterlab.commands._node_check():

Please install nodejs 5+ and npm before continuing. nodejs may be installed using conda or directly from the nodejs website.

so I used the following commands to install these packages:

conda install -c conda-forge nodejs
conda install -c cpcloud npm

Today I was reading on www.npmjs.com that npm is included whenever one installs nodejs. I ran the following commands to change my installation:

conda remove nodejs npm
conda install -c conda-forge nodejs

I repeated the jupyter labextension install @jupyter-widgets/jupyterlab-manager command and everything works now including ipywidgets displaying correctly in JupyterLab.

I guess the old npm package was over-writing the npm.cmd file which was installed by the nodejs package.

I just tried reinstalling nodejs as specified above, i get a 'Filename too long' error

(base) C:\Users\b>conda install -c conda-forge nodejs
Solving environment: done

## Package Plan ##

  environment location: C:\Users\b\AppData\Local\Continuum\anaconda3

  added / updated specs:
    - nodejs


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    nodejs-9.11.1              |                0        12.6 MB  conda-forge

The following NEW packages will be INSTALLED:

    nodejs:          9.11.1-0          conda-forge

The following packages will be UPDATED:

    ca-certificates: 2018.03.07-0                  --> 2018.4.16-0      conda-forge
    certifi:         2018.4.16-py36_0              --> 2018.4.16-py36_0 conda-forge
    conda:           4.5.4-py36_0                  --> 4.5.4-py36_0     conda-forge
    openssl:         1.0.2o-h8ea7d77_0             --> 1.0.2o-vc14_0    conda-forge [vc14]

Proceed ([y]/n)? y


Downloading and Extracting Packages
nodejs-9.11.1        | 12.6 MB | ###########################################################6                    |  76%

FileNotFoundError(2, 'The filename or extension is too long')

I had to rollback to earlier version of nodejs (v8) in order to install jupyter labextension install @jupyter-widgets/[email protected]
I hope it will be of help to anyone as I was stuck for a while.
Thanks

thanks @stevenwinfield. It does help my case too (not working with nodejs 11).

I have the same issue on Windows 10, tried it with different versions of NodeJS (8,10,11). I finally fixed it by commenting out line 1321 in \

ret = self._run([which('npm'), 'pack', source], cwd=tempdir, quiet=quiet)
if ret != 0:
    msg = '"%s" is not a valid npm package'
    #raise ValueError(msg % source)   <----
    print(msg)

The problem seems to be that npm returns non-zero exit code even though it installs the package correctly.

Face the same error message, and got it works using sudo:

(base) 00:20:15:69 ~ sudo jupyter labextension install @jupyter-widgets/jupyterlab-manager
Password:
Building jupyterlab assets (build:prod:minimize)
(base) 00:23:52:69 ~ 
Was this page helpful?
0 / 5 - 0 ratings