我正在尝试发布电容器插件。根据错误,它无法识别rm。我正在使用Window的Powershell(VC代码)

问题描述 投票:0回答:1

我正在尝试发布电容器发布插件。根据错误,它无法识别rm。我正在使用Window的Powershell(VC代码)当npm在运行中发布时,在Powershell中生成以下错误

PS C:\Users\xxxxx\Documents\demo-plugin> npm run build

[email protected] build C:\Users\xxxxx\Documents\demo-plugin
npm run clean && tsc


[email protected] clean C:\Users\xxxxxx\Documents\demo-plugin
rm -rf ./dist

'rm' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] clean: `rm -rf ./dist`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] clean script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\xxxxxx\AppData\Roaming\npm-cache\_logs\2019-12-16T10_11_18_987Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `npm run clean && tsc`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\xxxxxx\AppData\Roaming\npm-cache\_logs\2019-12-16T10_11_19_090Z-debug.log

package.json文件:

{
  "name": "demo-plugin",
  "version": "0.0.1",
  "description": "Demo",
  "main": "dist/esm/index.js",
  "types": "dist/esm/index.d.ts",
  "scripts": {
    "build": "npm run clean && tsc",
    "clean": "rm -rf ./dist",
    "watch": "tsc --watch",
    "prepublishOnly": "npm run build"
  },
  "author": "Puru",
  "license": "MIT",
  "dependencies": {
    "@capacitor/core": "latest"
  },
  "devDependencies": {
    "typescript": "^3.2.4",
    "@capacitor/ios": "latest",
    "@capacitor/android": "latest"
  },
  "files": [
    "dist/",
    "ios/",
    "android/",
    "DemoPlugin.podspec"
  ],
  "keywords": [
    "capacitor",
    "plugin",
    "native"
  ],
  "capacitor": {
    "ios": {
      "src": "ios"
    },
    "android": {
      "src": "android"
    }
  },
  "repository": {
    "type": "git",
    "url": "-"
  },
  "bugs": {
    "url": "-/issues"
  }
}

我正在尝试发布由npm generate命令生成的默认插件,出于测试目的,不做任何更改。

ionic-framework npm capacitor
1个回答
0
投票

在Windows中,您应该使用

rd /s /q dist

rm在Linux和Mac中可用。

参考:

© www.soinside.com 2019 - 2024. All rights reserved.