mounten Ich erstellte eine Beispiel-Express-Site in meinem Benutzerverzeichnis und montiert es auf einem Docker-Container und es funktioniert. Bitte beachten Sie die folgende Ausgabe:Konnte keinen Ordner auf C-Laufwerk als Volume
[email protected] MINGW64 ~/ExpressSite
$ docker run -p 8080:3000 -v $(pwd):/var/www1 -w "/var/www1" node npm start
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm info lifecycle [email protected]~prestart: [email protected]
npm info lifecycle [email protected]~start: [email protected]
> [email protected] start /var/www1
> node ./bin/www
Wenn ich Kopieren/das gleiche Verzeichnis in einem Ordner einfügen namens dockertest auf Laufwerk C, es unten Fehlermeldung erhalten:
[email protected] MINGW64 /c/dockertest/ExpressSite
$ docker run -p 8080:3000 -v $(pwd):/var/www1 -w "/var/www1" node npm start
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm ERR! Linux 4.4.27-boot2docker
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v7.0.0
npm ERR! npm v3.10.8
npm ERR! path /var/www1/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/var/www1/package.json'
npm ERR! enoent ENOENT: no such file or directory, open '/var/www1/package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /var/www1/npm-debug.log
Bin ich hier etwas fehlt?
[email protected] MINGW64 /c/dockertest/ExpressSite
$ ls
app.js bin/ node_modules/ package.json public/ routes/ views/
Konnte nicht, welchen Unterschied im zweiten Fall gemacht wurde? – Rao
Speicherort des ExpressSite-Ordners. Beim ersten Startbefehl befindet er sich in meinem Home-Verzeichnis und im zweiten bei C: \ dockertest – Asdfg
Enthält dieser Ordner 'package.json'? Führen Sie den Befehl innerhalb dieses Ordners aus? 'npm-debug.log' wird zur Laufzeit erstellt? – Rao