我正在尝试在 docker 容器中运行 typescript express.js。运行docker后,我收到以下错误:
> ts-node-dev src/app.ts
Using ts-node version 8.10.1, typescript version 3.9.2
TypeError [ERR_FEATURE_UNAVAILABLE_ON_PLATFORM]: The feature watch recursively is unavailable on the current platform, which is being used to run Node.js
at Object.watch (fs.js:1441:11)
at add (/app/node_modules/filewatcher/index.js:74:34)
at /app/node_modules/filewatcher/index.js:93:5
at FSReqCallback.oncomplete (fs.js:176:5)
Run Code Online (Sandbox Code Playgroud)
我的 Dockerfile:
FROM node:alpine
WORKDIR /app
COPY package.json .
RUN npm install
COPY . .
CMD ["npm","start"]
Run Code Online (Sandbox Code Playgroud)
和 package.json 文件:
{
"name": "app-name",
"version": "1.0.0",
"description": "Init master",
"main": "src/app.ts",
"scripts": {
"build": "./node_modules/.bin/tsc",
"start": …Run Code Online (Sandbox Code Playgroud) 我在使用 gulp 4 构建时遇到问题。
我得到这个错误:
Error: File not found with singular glob: /app/build/js/all.min.js (if this was purposeful, use `allowEmpty` option)
at Glob.<anonymous> (/app/node_modules/glob-stream/readable.js:84:17)
at Object.onceWrapper (events.js:315:30)
at emitOne (events.js:116:13)
at Glob.emit (events.js:211:7)
at Glob._finish (app/node_modules/glob/glob.js:197:8)
at done (app/node_modules/glob/glob.js:182:14)
at Glob._processSimple2 (app/node_modules/glob/glob.js:688:12)
at app/node_modules/glob/glob.js:676:10
at Glob._stat2 (app/node_modules/glob/glob.js:772:12)
at lstatcb_ (app/node_modules/glob/glob.js:764:12)
at RES (/app/node_modules/inflight/inflight.js:31:16)
at f (app/node_modules/once/once.js:25:25)
at FSReqWrap.oncomplete (fs.js:152:21)
Run Code Online (Sandbox Code Playgroud)
这是我的 gulpfile.js
var gulp = require('gulp');
var environments = require('gulp-environments');
var htmlReplace = require('gulp-html-replace');
var preprocess = require('gulp-preprocess');
var replace = require('gulp-replace'); …Run Code Online (Sandbox Code Playgroud)