GVKun编程网logo

cygwin / windows下的NPM脚本:命令的语法不正确(npm命令报错)

15

本文将分享cygwin/windows下的NPM脚本:命令的语法不正确的详细内容,并且还将对npm命令报错进行详尽解释,此外,我们还将为大家带来关于bash–find(1):CygWin下的“参数格式

本文将分享cygwin / windows下的NPM脚本:命令的语法不正确的详细内容,并且还将对npm命令报错进行详尽解释,此外,我们还将为大家带来关于bash – find(1):CygWin下的“参数格式不正确”、Building openresty1.7.10.1 with luajit on windows using Cygwin, 在windows下用Cygwin下编译带Luajit的openresty、Cygwin 1.7.1 发布 - Windows下的Linux开发、Cygwin 3.1.0 发布,Windows下的Linux开发环境的相关知识,希望对你有所帮助。

本文目录一览:

cygwin / windows下的NPM脚本:命令的语法不正确(npm命令报错)

cygwin / windows下的NPM脚本:命令的语法不正确(npm命令报错)

我在Windows 7计算机上运行Node 6.9.5和NPM 3.10.10。我的终端是Cygwin 2.877。

如果我尝试在Cygwin中运行以下命令,则效果很好:

mkdir mydir/mysubdir;

但是,如果我将其放入package.json文件中,例如:

"scripts": { "test": "mkdir mydir/mysubdir"},

并运行:

npm run test

它失败并显示:

The syntax of the command is incorrect.

仔细搜索以上内容之后,似乎是Windows命令提示符错误,而不是Cygwin错误。因此,似乎NPM尝试使用命令提示符而不是现有的Cygwin环境运行脚本。

我怎样才能解决这个问题?或者更确切地说,如何确保NPM在正在从其调用的终端环境中运行脚本?

答案1

小编典典

该脚本始终在默认的Windows Shell中运行,而不是在cygwin中运行。

如果您希望它在bash中运行,则将其放入package.json

"scripts": {    "test": "bash test.sh"},

并放在test.sh

#!/bin/bashmkdir mydir/mysubdir

或者,如csvan在评论中指出的,您可以使用Node脚本而不是Shell脚本:

"scripts": {    "test": "node test.js"},

这种方法对于跨平台兼容性甚至更好。

bash – find(1):CygWin下的“参数格式不正确”

bash – find(1):CygWin下的“参数格式不正确”

我正试图从源头建立Bochs.因此,我写了一个配置脚本.我没有从头开始编写脚本 – 它基于Bochs tarball中的.conf.win32-vcpp sh脚本.导致问题的脚本部分是原始的Nochs tarball,没有任何改变 – 我没有写那部分.

我的问题:

每次执行我的sh脚本时,都会发生以下错误:

[...]
config.status: creating host/linux/pcidev/Makefile
config.status: creating config.h
config.status: creating ltdlconf.h
config.status: ltdlconf.h is unchanged
FIND: Parameterformat falsch

*(Parameterformat falsch表示参数格式不正确)

但我不需要执行大厅脚本.那个rub片段就足够了:

sh-4.1$find -name Makefile
FIND: Parameterformat falsch

*(Parameterformat falsch表示参数格式不正确)

我的问题:

>该脚本片段有什么问题:找到. -name Makefile?任何的想法?
>如何重写代码的这一部分才能使其正常工作?

我的剧本:

#!/bin/sh

set echo

./configure --target=pentium-windows \
            --enable-sb16 \
            --enable-ne2000 \
            --enable-all-optimizations \
            --enable-cpu-level=6 \
            --enable-x86-64 \
            --enable-pci \
            --enable-clgd54xx \
            --enable-usb \
            --enable-usb-ohci \
            --enable-show-ips \
            --enable-disasm \
            --enable-iodebug \
            --enable-logging \
            --enable-debugger-gui \
            --disable-readline \
            --without-x \
            --with-win32 \
            --with-rfb \
            --with-nogui \
            --with-wx

unset echo

# Fix up all makefiles so that nmake can handle them.

– >狗被埋的地方:

for i in `find . -name Makefile`; do
  echo Removing curly brackets in $i for NMAKE.
  mv $i $i.tmp
  sed -e 's/{/(/g' -e 's/}/)/g' < $i.tmp > $i
  rm -f $i.tmp
done

我的环境:

我不知道这是否重要,但我没有使用普通的bash.我使用cygwin的sh命令(Win64)提供的shell.

谢谢.

解决方法

确保您的Cygwin安装包含findutils包,并且Cygwin的查找首先在您的PATH中(在本机Windows之前).

如果find –help返回FIND:Paramater格式不正确(或你的本地化等价物),这是一个肯定的迹象,它是Windows,而不是当前正在使用的Cygwin格式.

Building openresty1.7.10.1 with luajit on windows using Cygwin, 在windows下用Cygwin下编译带Luajit的openresty

Building openresty1.7.10.1 with luajit on windows using Cygwin, 在windows下用Cygwin下编译带Luajit的openresty

总结

以上是小编为你收集整理的Building openresty1.7.10.1 with luajit on windows using Cygwin, 在windows下用Cygwin下编译带Luajit的openresty全部内容。

如果觉得小编网站内容还不错,欢迎将小编网站推荐给好友。

Cygwin 1.7.1 发布 - Windows下的Linux开发

Cygwin 1.7.1 发布 - Windows下的Linux开发

Cygwin是许多自由软件的集合,最初由Cygnus Solutions开发,用于各种版本的Microsoft Windows上,运行UNIX类系统。Cygwin的主要目的是通过重新编译,将POSIX系统(例如Linux、BSD,以及其他Unix系 统)上的软件移植到Windows上。Cygwin移植工作在Windows NT、Windows 2000、Windows XP以及Windows Server 2003上比较好,在Windows 95和Windows 98上,相对差劲一些。目前Cygwin由Red Hat等负责维护。

新版本增加了对 Windows 7 和 Windows Server 2008 R2的支持,以及其他方面的一些改进。

下载地址: http://cygwin.com/packages/

Cygwin 3.1.0 发布,Windows下的Linux开发环境

Cygwin 3.1.0 发布,Windows下的Linux开发环境

Cygwin 3.1.0 发布了,Cygwin是许多自由软件的集合,最初由Cygnus Solutions开发,用于各种版本的Microsoft Windows上,运行UNIX类系统。Cygwin的主要目的是通过重新编译,将POSIX系统(例如Linux、BSD,以及其他Unix系统)上的软件移植到Windows上。Cygwin移植工作在Windows NT、Windows 2000、Windows XP以及Windows Server 2003上比较好,在Windows 95和Windows 98上,相对差劲一些。目前Cygwin由Red Hat等负责维护。

新版本包括:

* cygwin-3.1.0-1
* cygwin-devel-3.1.0-1
* cygwin-doc-3.1.0-1

该版本包含一些新特性和 bug 修复,主要有:

- Add 24 bit color support using xterm compatibility mode in Windows 10
  1703 or later.  Add fake 24 bit color support for legacy console,
  which uses the nearest color from 16 system colors.

- Support pseudo console in PTY. Pseudo console is a new feature
  in Windows 10 1809, which provides console APIs on virtual
  terminal. With this patch, native console applications can work
  in PTYs such as mintty, ssh, gnu screen or tmux.

- New APIs: sched_getaffinity, sched_setaffinity, pthread_getaffinity_np,
  pthread_setaffinity_np, plus CPU_SET macros.

- New APIs: dbm_clearerr, dbm_close, dbm_delete, dbm_dirfno, dbm_error,
  dbm_fetch, dbm_firstkey, dbm_nextkey, dbm_open, dbm_store.


What changed:
-------------

- FIFOs can now be opened multiple times for writing.
  Addresses: https://cygwin.com/ml/cygwin/2015-03/msg00047.html
             https://cygwin.com/ml/cygwin/2015-12/msg00311.html

- If a SA_SIGINFO signal handler changes the ucontext_t pointed to by
  the third parameter, follow it after returning from the handler.

- Eliminate a header file name collision with <X11/XLocale.h> on case
  insensitive filesystems by reverting <xlocale.h> back to <sys/_locale.h>.

- Allow times(2) to have a NULL argument, as on Linux.
  Addresses: https://cygwin.com/ml/cygwin/2019-09/msg00141.html

- Improve /proc/cpuinfo output and align more closely with Linux.

- Raise stackdump frame limit from 16 to 32.
  Addresses: https://cygwin.com/ml/cygwin/2019-11/msg00038.html


Bug Fixes
---------

- Fix select() on console in canonical mode.  Return after one line is
  completed, instead of when only one key is typed.

- Make console I/O functions thread-safe.

- Define missing MSG_EOR.  It''s unsupported by the underlying Winsock
  layer so using it in send(2), sendto(2), or sendmsg(2) will return -1
  with errno set to EOPNOTSUPP and recvmsg(2) will never return it.

- Fix a timerfd deadlock.
  Addresses: https://cygwin.com/ml/cygwin/2019-06/msg00096.html

- Fix sigpending() incorrectly returning signals for unrelated threads.
  Addresses: https://cygwin.com/ml/cygwin/2019-07/msg00051.html

- Fix a hang when opening a FIFO with O_PATH.
  Addresses: https://cygwin.com/ml/cygwin-developers/2019-06/msg00001.html

- Don''t append ".lnk" when renaming a socket file.
  Addresses: https://cygwin.com/ml/cygwin/2019-07/msg00139.html

- Make tcsetpgrp() return -1 if its argument is negative.
  Addresses: https://cygwin.com/ml/cygwin/2019-07/msg00166.html

- Avoid mistakenly moving a process under debugger control into the
  process group of the debugger.
  Addresses a problem visible in GDB 8.1.1, related to
  https://cygwin.com/ml/cygwin/2019-07/msg00166.html

- Return ENOEXEC from execve for arbitrary files only if the files are
  executable.
  Addresses: https://cygwin.com/ml/cygwin/2019-08/msg00054.html

- Fix off-by-one in environment evaluation leading to an abort.
  Addresses: https://cygwin.com/ml/cygwin-patches/2019-q3/msg00069.html

- Make output of /proc/[PID]/stat consistent with getpriority().
  Addresses: https://cygwin.com/ml/cygwin/2019-08/msg00082.html

- 64 bit only: Avoid collisions between memory maps created with shmat
  and Windows datastructures during fork.
  Addresses: https://cygwin.com/ml/cygwin/2019-08/msg00107.html

- Make rmdir fail if its argument is a symlink.
  Addresses: https://cygwin.com/ml/cygwin/2019-09/msg00221.html

- Fix an assertion failure on an invalid path.
  Addresses: https://cygwin.com/ml/cygwin/2019-09/msg00228.html

- If the argument to mkdir(2) or rmdir(2) is ''x:\'', don''t strip the
  trailing backslash.
  Addresses: https://cygwin.com/ml/cygwin/2019-08/msg00334.html

- Make spawnvp, spawnvpe fail if the executable is not in $PATH.
  Addresses: https://cygwin.com/ml/cygwin/2019-10/msg00032.html

- Fix parent/child relationship after parent dies.
  Addresses: https://cygwin.com/ml/cygwin/2019-09/msg00263.html

- Fix a security problem if Cygwin is installed into a path
  with spaces in it.
  Addresses: https://cygwin.com/ml/cygwin/2019-11/msg00018.html

- Fix an assertion failure when /cygdrive contains an offline network
  drive.
  Addresses: https://cygwin.com/ml/cygwin/2019-12/msg00016.html

- Fix return value of ilogbl for 0 input.
  Addresses: https://cygwin.com/ml/cygwin/2019-12/msg00074.html

- Let strtold set errno to ERANGE on underflow per POSIX.
  Addresses: https://cygwin.com/ml/cygwin/2019-12/msg00072.html

我们今天的关于cygwin / windows下的NPM脚本:命令的语法不正确npm命令报错的分享就到这里,谢谢您的阅读,如果想了解更多关于bash – find(1):CygWin下的“参数格式不正确”、Building openresty1.7.10.1 with luajit on windows using Cygwin, 在windows下用Cygwin下编译带Luajit的openresty、Cygwin 1.7.1 发布 - Windows下的Linux开发、Cygwin 3.1.0 发布,Windows下的Linux开发环境的相关信息,可以在本站进行搜索。

本文标签: